Atlassian interview question

basically LC 1366 Rank Teams by Votes