Coding 1
You are given an array of integers nums and an integer k.
Return the k most frequent elements in the array.
This problem asks for the k most frequent integers in an array. A typical solution counts frequencies with a hash map, then selects the top k entries using a min-heap, bucket sort, or quickselect. The key is to avoid sorting the entire array and instead focus on efficient frequency tracking and top-k selection.