Editorial for Friendship is a number

Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.

Store both ID number and friendship score in a list like structure, and sort based on friendship score. Then print out the last three IDs.

Skills needed: Array manipulation, for loops

Time complexity: \mathcal O(N \log N + \sum T)


There are no comments at the moment.