less than 1 minute read

You are given a list of integers nums, representing the number of chess matches each person has won. Return a relative ranking (0-indexed) of each person. If two players have won the same amount, their ranking should be the same.

Constraints

  • n ≤ 100,000 where n is the length of nums

https://binarysearch.com/problems/Leaderboard

Examples

Example 1

Input

  • nums = [50, 30, 50, 90, 10]

Output

  • answer = [1, 2, 1, 0, 3]

Solution

Leave a comment