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.
Great solution. You could also do away with the 'i' variable and the while loop by replacing them with a for loop.
n = int(input())
arr = list(map(int, input().split()))
largest = max(arr)
for i in range(n):
if largest == max(arr):
arr.remove(max(arr))
print(max(arr))
Find the Runner-Up Score!
You are viewing a single comment's thread. Return to all comments →
Great solution. You could also do away with the 'i' variable and the while loop by replacing them with a for loop.
edit: fixed logical error