Sponsored
Use these hints if you're stuck. Try solving on your own first.
Maintain sorted pairs <code>(nums[index], index)</code> in a priority queue.
Simulate the operation <code>k</code> times.
Solve with full IDE support and test cases