Skip to content

Instantly share code, notes, and snippets.

@manashmandal
Created November 23, 2016 17:03
Show Gist options
  • Save manashmandal/2ce709a9f2676b58efe8004a85eb3cf1 to your computer and use it in GitHub Desktop.
Save manashmandal/2ce709a9f2676b58efe8004a85eb3cf1 to your computer and use it in GitHub Desktop.
HackerRank Problems
# Python3
# https://www.hackerrank.com/challenges/nested-list
n = int(input())
students = []
for i in range(n):
name = input()
mark = input()
students.append([name, float(mark)])
# Getting the marks [sorted]
second_lowest = sorted(list(set([students[i][1] for i in range(n)])))[1]
# Getting the persons who got the second lowest mark
students_second_lowest = sorted([student[0] for student in students if student[1] == second_lowest])
for student in students_second_lowest:
print(student)
@porimol
Copy link

porimol commented Nov 23, 2016

what will be the output, if I try as like this example(test case)?

1
Harry
37.21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment