Given an integer array `nums` and an integer `k`, return the `k` most frequent elements, in any order.
Counting occurrences and ranking them is daily work in a lab. Here you make it efficient.
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1, 2]
// hit Run to execute the sample tests
// Interactive editor preview. Live code execution arrives with your early-access cohort.