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.
Climbing the Leaderboard
Climbing the Leaderboard
Sort by
recency
|
2368 Discussions
|
Please Login in order to post a comment
Until the problem statement clearly specifies that the leaderboard is immutable (meaning the player's scores, as they are processed and a ranking is assigned, do not change the leaderboard), I don't believe the timeout test cases are valid. You need to KNOW that the leaderboard is intended to be immutable to achieve the needed performance. Am I wrong?
Or you need to know that player scores are always increasing, which is nowhere near a valid real world scenario.
Does this problem have these assumptions?
1) Player scores will always be ascending? 2) Player scores do not mutate the leaderboard when they come in?
If so, are these assumptions ever mentioned in the problem statement?
Here is my solution in C++:
This times out on large ranked input > 100k
r = sorted(list(set(ranked)), reverse=True)