We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This short Python solution takes advantage of the fact that the player scores are listed in ascending order. We first make a sorted list of unique leader scores, then for each player score, removing the elements which are smaller than the player score, the length of the remaining leader scores plus one is thus the rank of the player score. The process is continued with the shorten leader scores list, thus saves a lot of steps.
Climbing the Leaderboard
You are viewing a single comment's thread. Return to all comments →
This short Python solution takes advantage of the fact that the player scores are listed in ascending order. We first make a sorted list of unique leader scores, then for each player score, removing the elements which are smaller than the player score, the length of the remaining leader scores plus one is thus the rank of the player score. The process is continued with the shorten leader scores list, thus saves a lot of steps.