Fix an almost sorted array.
Asked in the Round 1 stage. The question was discussed after Android questions.
An array is k-almost sorted if every value is no more than k positions away from its position in the fully sorted array. Implement fix_almost_sorted(nums, k) and return the sorted array. Do not modify nums.
def fix_almost_sorted(nums, k):