Locked

Pass the Dictionary check first

Everything after it builds on dictionaries. Each rep in the check has to be passed without opening the solution. Hints and Basics are fine.

Still to clear · 8 of 8

Continue the check

Preview · where this ladder is heading

K-th largest value

Given a list of integers nums and an integer k (1 <= k <= len(nums)), return the value that would be at position k if the list were sorted from largest to smallest. Duplicates count separately: in [3, 3, 1] the 2nd largest is 3.

Aim for better than sorting the whole list.

innums = [3, 2, 1, 5, 6, 4], k = 2out5
innums = [3, 2, 3, 1, 2, 4, 5, 5, 6], k = 4out4
innums = [7], k = 1out7

You can read it now. The editor opens when the check is cleared.