Top K Frequent Elements — count, then take the k highest
Count how often each value appears, then pick the k most frequent.
Try:
input
frequency
answer (top k)