def second_score(entrada):
score_by_name = dict(entrada)
minimum = min(score_by_name.values())
names_and_score_except_min = {k: v for k, v in score_by_name.items() if v > minimum}
second_minimum = min(names_and_score_except_min.values())
second_min_score_by_name = {k: v for k, v in score_by_name.items() if v == second_minimum}
second_minimum_names = sorted(list(second_min_score_by_name.keys()))
for name in second_minimum_names:
print(name)
def parse_entrada():
array_size_line = input().strip()
array_size = int(array_size_line)
result = []
for _ in range(array_size):
name = input()
score = float(input())
result.append([name, score])
return result
if __name__ == '__main__':
entrada = parse_entrada()
second_score(entrada)
El enunciado puede encontrarse en: https://www.hackerrank.com/challenges/nested-list/problem
@ramoncorominas @eun-plata