You are viewing a single comment's thread. Return to all 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
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Runner-Up Score!
You are viewing a single comment's thread. Return to all comments →