FunctionRacerProblemsRace

Ranks Without Gaps

MediumNumPyPython

Return the rank of each score: the highest score has rank 1, equal scores share a rank, and the next lower score gets the next rank, with no ranks skipped. No loops: for and while are not allowed.

Example 1

scores [50,80,80,20]
returns [2,1,1,3]

The two 80s share rank 1, 50 is rank 2 and 20 is rank 3.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems