// Top K Frequent Elements — MEDIUM
// Category: hash-map
Given an integer array `nums` and an integer `k`, return the `k` most frequent elements. Return them **sorted in ascending order**.
You may assume the answer is unique — there is always exactly one answer with a unique top-k.
**Constraints:**
- `1 <= nums.length <= 10⁵`
Example: nums = [1,1,1,2,2,3], k = 2
Output: [1,2]