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.
arr.sort(reverse = True)
length = len(arr)
runner_up=""
if length > 1:
for i in range(n):
if arr[i] != arr[i+1]:
runner_up=arr[i+1]
break
print(runner_up)
Cookie support is required to access HackerRank
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 →
arr.sort(reverse = True) length = len(arr) runner_up="" if length > 1: for i in range(n): if arr[i] != arr[i+1]: runner_up=arr[i+1] break print(runner_up)