runner up score hackerrank solution
from collections import Counter
if __name__ == '__main__':
n = int(raw_input())
arr = Counter(map(int, raw_input().split())).keys()
arr.sort()
print arr[-2]
runner up score hackerrank solution
from collections import Counter
if __name__ == '__main__':
n = int(raw_input())
arr = Counter(map(int, raw_input().split())).keys()
arr.sort()
print arr[-2]
find the runner-up score
n = int(input())
arr = list(map(int, input().split()))
zes = max(arr)
i=0
while(i<n):
if zes ==max(arr):
arr.remove(max(arr))
i+=1
print(max(arr))
#note: do not use set() will not work for negative numbers
# contact me : [email protected]
Find the Runner-Up Score!
if __name__ == '__main__':
n = int(input())
arr = map(int, input().split())
score = []
for c in list(arr):
if c not in score:
score.append(c)
else:
continue
score.sort()
print(score[len(score)-2])
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us