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
|
8146 Discussions
|
Please Login in order to post a comment
this is also way. arr = list(map(int, input(f"Enter {n} integers (-100 <= A[i] <= 100): ").split())) ---> convert arr into list
n = int(input())
arr = list(map(int, input().split()))
while len(arr) != n:
runner_up = sorted(set(arr))
runner_up.pop()
print(runner_up[-1]) `
if name == 'main': n = int(input())
arr = map(int, input().split()) **** x = set(arr)
sortingx = sorted(x, reverse=True)
n = int(input()) arr = list(map(int, input().split())) seen = set() unique_list = [x for x in arr if x not in seen and not seen.add(x)] unique_list.sort print(unique_list[-2])
whats the problem with this?