For this Question: Given an N-size array of unique integers, your task is to print the array in a waveform, i. e a1 >= a2 <= a3 >= a4 <= a5.. . print the lexicographically smallest array possible.The first line of input contains a single integer N, next line contains N space-separated integers depicting the values of the array.

<b>Constraints:-</b>
1 &le; N &le; 10<sup>5</sup>
1 &le; Arr[i] &le; 10<sup>9</sup>Print the array in wave form as mentioned.Sample Input :-
5
2 1 3 5 4

Sample Output:-
2 1 4 3 5

Sample Input:-
3
1 2 3

Sample Output:-
2 1 3, I have written this Solution Code: n = int(input())
a = list(map(int,input().strip().split()))
a.sort()

for i in range(0,n-1,2):
    print("{} ".format(a[i+1]),end="")
    print("{} ".format(a[i]),end="")
if n&1:
    print("{} ".format(a[n-1])), In this Programming Language: Python, Now tell me if this Code is compilable or not?