Given an integer array where each element is at most k positions away from its sorted position, sort the array in a non-decreasing order.
k
Input: nums = [5, 1, 9, 4, 7, 10], k = 2 Output: [1, 4, 5, 7, 9, 10]