You are viewing a single comment's thread. Return to all comments →
if name == 'main': N = int(input())
# Read the scores as a map object and convert to a list of integers # The 'map' function output must be converted to a list explicitly.
scores = list(map(int, input().split())) unique_scores = set(scores) sorted_unique_scores = sorted(list(unique_scores)) runner_up_score = sorted_unique_scores[-2]
print(runner_up_score)
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 →
if name == 'main': N = int(input())
scores = list(map(int, input().split())) unique_scores = set(scores) sorted_unique_scores = sorted(list(unique_scores)) runner_up_score = sorted_unique_scores[-2]
print(runner_up_score)