Answers for "Find the Runner-Up Score!"

1

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]
Posted by: Guest on August-18-2020
1

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]
Posted by: Guest on May-26-2020
0

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])
Posted by: Guest on November-18-2021

Code answers related to "Find the Runner-Up Score!"

Browse Popular Code Answers by Language