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.
A good way to solve the problem is to store distinct values of the scores with O(N) complexity.
For example, Test Case scores are:
100 100 50 40 40 20 10
You only need to store:
100 50 40 20 10
Then use a simple binary search catered to a descending list which returns the corresponding index.
Climbing the Leaderboard
You are viewing a single comment's thread. Return to all comments →
A good way to solve the problem is to store distinct values of the scores with O(N) complexity. For example, Test Case scores are: 100 100 50 40 40 20 10
You only need to store: 100 50 40 20 10
Then use a simple binary search catered to a descending list which returns the corresponding index.