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__':`#readthenumberofnameandscores`records={}for_inrange(int(input())):``#readtherecords`name=input()score=float(input())records[name]=score#find the mininum value of scorelista=list(records.values())m=min(lista)#create a new list without the minimum valuelista=[xforxinlistaifx!=m]#find the second minimum valuem=min(lista)#create a new list with only the name of the second minimum value and print itlista=[]forkeyinrecords.keys():ifrecords[key]==m:lista.append(key)lista.sort()fornameinlista:print(name)
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 →