




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Build array rank where rank[i][j] is the number of votes for team i to be the j-th rank.
Sort the teams by rank array. if rank array is the same for two or more teams, sort them by the ID in ascending order.