Skip to content

Instantly share code, notes, and snippets.

@rjshekar90
Created February 23, 2017 06:32
Show Gist options
  • Save rjshekar90/74b1e3b2010cdf2e0b8a4a3444a40920 to your computer and use it in GitHub Desktop.
Save rjshekar90/74b1e3b2010cdf2e0b8a4a3444a40920 to your computer and use it in GitHub Desktop.
#Hackerrank ------ Nested Lists
from collections import defaultdict
grades = defaultdict(list)
for _ in range(input()):
name = raw_input()
score = float(raw_input())
grades[score].append(name)
print "\n".join(sorted(grades[sorted(grades.keys())[1]]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment