Arista Networks interview question

Leetcode 347, Top K most frequent element