Find the Runner-Up Score!

Sort by

recency

|

8108 Discussions

|

  • + 0 comments

    print(sorted(set(list(arr)))[-2])

  • + 0 comments

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

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

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

    runner_score=sorted(set(arr))[-2]
    print(runner_score)
    
  • + 0 comments

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

        #Write below code
    print(sorted(set(arr))[-2])
    
  • + 0 comments
    n = int(input())  # Read the number of elements (not used directly)
    arr = map(int, input().split())  # Read space-separated integers and convert them to int
    s = set(arr)  # Convert to set to remove duplicates
    mx = max(s)  # Find the maximum value in the set
    s.remove(mx)  # Remove the maximum value
    print(max(s))  # Find and print the new maximum value