Medal Table Ranking with Cascading Tie-Breakers - Coding problem | OneNoughtOne