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.
if name == 'main':
records = []
for _ in range(int(input())):
name = input()
score = float(input())
records.append([name, score])
#print(records)
a = sorted(records, key=lambda x: x[1])
#print(a[4][1])
b= len(a)
d = []
#print(b)
for i in range(b) :
d = [a[i][1]] + d
d.sort()
#print(d)
for i in range (b) :
if d[i+1] > d[i] :
f = (d[i+1])
#print(f)
break
g = []
for i in range (b) :
if a[i][1] == f :
g = [a[i][0]] + g
g.sort()
#print(g)
for i in g :
print(i)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Lists
You are viewing a single comment's thread. Return to all comments →
if name == 'main':
records = [] for _ in range(int(input())): name = input() score = float(input())