For this Question: Given an array of n elements, where each element is at most k away from its position in the sorted array, you need to sort the array optimally.

Note: DO NOT use STL sort() function for this question.The first line contains two elements n and k separated by a space. The second line contains n elements of array.

Constraints:
1 <= n <= 100000
1 <= k <= n
1 <= arr(i) <= 1000000Print the sorted array.Sample Input:
7 3
6 5 2 3 8 10 9

Sample Output:
2 3 5 6 8 9 10, I have written this Solution Code: try:

    n,k=map(int,input().split())
    l=list(map(int,input().split()))
    l.sort()
    print(*l)
except:
    pass, In this Programming Language: Python, Now tell me if this Code is compilable or not?