Microsoft interview question

k-frequent elements leetcode style question