Find the Runner-Up Score!

  • + 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