DEV Community

Discussion on: HackerRank's Nested Lists Problem

Collapse
 
guillardi profile image
Marcio Guillardi da Silva

My code... more Pynthonic...

if __name__ == '__main__':
    records = []
    for _ in range(int(input())):
        name = input()
        score = float(input())
        records.append([name, score])

    scores = sorted(set([score for name, score in records]))

    print(*sorted([name for name, score in records if scores[1] == score]), sep = "\n")

Enter fullscreen mode Exit fullscreen mode