Common C++ interview problem: Top k frequent values.
Given a list of integers as std::vector<int> and the count k, return the top k most frequent values in the list in any order.
You can assume that the input leads to a unique solution, and your solution is required to operate faster than O(n*logn).
Solve it yourself: https://compiler-explorer.com/z/7E5bjq8sb
Solution: https://compiler-explorer.com/z/eKqcYPxfT