Returns up to n elements with their counts, highest count first.
Ties keep first-insertion order. Runs in time proportional to the number of distinct elements times its logarithm.
if n is negative.