Nested List | HackerRank

Asked: Anonymously | Category: Python

n=int(input()) arr=[[input(),float(input())] for _ in range(0,n)] arr.sort(key=lambda x: (x[1],x[0])) names = [i[0] for i in arr] marks = [i[1] for i in arr] min_val=min(marks) while marks[0]==min_val: marks.remove(marks[0]) names.remove(names[0]) for x in range(0,len(marks)): if marks[x]==min(marks): print(names[x])

8 views0 comments

Recent Posts

See All

Binary string reduction in Python

Asked: Sudeep |Category: Python x=int(input("Enter the value of x : ")) for i in range(x): n=int(input("Enter the value of n : ")) y=input("Enter the value of y : ") l=list(y) k=0

"Believe you can and you're halfway there"