You are viewing a single comment's thread. Return to all comments →
def climbingLeaderboard(ranked, player): ranked = sorted(set(ranked), reverse=True) # Remove duplicates and sort in descending order ranks = [] index = len(ranked) - 1 # Start from the lowest ranked for score in player: while index >= 0 and score >= ranked[index]: index -= 1 # Move up in the leaderboard ranks.append(index + 2) # Append the rank return ranks
Seems like cookies are disabled on this browser, please enable them to open this website
Climbing the Leaderboard
You are viewing a single comment's thread. Return to all comments →