scores, in no particular order. Find the score that lands at position rank when they are lined up from highest to lowest.
Equal scores take separate places: in [9, 9, 4], second place is 9, not 4.
Sorting the whole array works. Try to manage without it.scores=[40, 95, 12, 70, 88], rank=3 → 70
In descending order: 95, 88, 70, 40, 12. Third place is 70.
scores=[50, 80, 80, 20], rank=2 → 80
Repeats count separately: 80, 80, 50, 20, so second place is 80 too.
scores=[-5], rank=1 → -5
scores=[40, 95, 12, 70, 88], rank=3
70
Run checks the first 3 tests in your browser. Submit checks all 81 tests on the server, hidden ones included.