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()) records.append([name, score]) sorted_arr=sorted(records, key=(lambda records: (records[1],records[0]))) max_val=sorted_arr[0][1] new_arr=[arr for arr in sorted_arr if arr[1]!= max_val] second_highest=min([ele[1] for ele in new_arr]) for arr in new_arr: if arr[1]==second_highest: print(arr[0])
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 →