Find the Runner-Up Score!

Sort by

recency

|

8330 Discussions

|

  • + 0 comments

    if name == 'main': n = int(input()) arr = list(set(map(int, input().split()))) first=second=float('-inf') for i in arr: if i>first: second=first first=i elif i>second: second=i print(second)

  • + 0 comments

    if name == 'main': n = int(input()) arr = list(set(map(int, input().split()))) first=second=float('-inf') for i in arr: if i>first: second=first first=i elif i>second: second=i print(second)

  • + 0 comments
    if __name__ == '__main__':
        n = int(input())
        arr = map(int, input().split())
        sorted_list = sorted(arr)
        unique_score = set(sorted_list)
        unique_score.pop()
        runner_up = max(unique_score)
        print(runner_up)
    
  • + 0 comments

    if name == 'main': n = int(input()) arr = list(map(int, input().split()))

    s = list(set(arr))
    s.sort(reverse = True)
    print(s[1])
    
  • + 0 comments

    if name == 'main': n = int(input()) arr = list(map(int, input().split())) secound_highest = max(arr)-1 print(secound_highest)