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

Most frequent k values

Given a list of integers nums and an integer k, return the k values that occur most often. Return them in any order. You may assume the answer is unique (no tie at the cut-off).

Try to do better than sorting every distinct value.

innums = [1, 1, 1, 2, 2, 3], k = 2out[1, 2]
innums = [5], k = 1out[5]
innums = [4, 4, -1, -1, -1, 7], k = 1out[-1]

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