Ctrl K
Problem

K-th Highest Score

Medium · K-th Highest Score

You have the scores of a competition's participants as an integer array `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.…

Solve the problem →