We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Find the Runner-Up Score!
Find the Runner-Up Score!
Sort by
recency
|
8013 Discussions
|
Please Login in order to post a comment
arr.sort(reverse = True) largest = arr[0] for element in arr[1 :]: if element < largest: print(element) break
My code is the following
n = int(input()) arr = set(map(int, input().split())) n_arr = list(arr) n_arr = sorted(n_arr) print(n_arr[-2])
and there are two cases where I get errors, but when I run them from my computer they give me the expected results.
if name == 'main': n = int(input()) arr = map(int, input().split())
if name == 'main':