#I am trying to print runner up score. but the problem is, it is showing the output is in squarebracket in #hackerrank. I tried with replace method, for loop.
n = input() [input is in terms like: 1 2 3 4]
arr = [int(i) for i in n.split(" ")]
arr.sort(reverse = True)
print (arr)
counter = arr.count(arr[0])
if counter > 1:
print(arr[counter])
else:
print(arr[1])
Replace method and for loop
New contributor