You are viewing a single comment's thread. Return to all comments →
Make this exact changes to work properly in python3 otherwise it would not work irrespective of output being correct
def findZigZagSequence(a, n): a.sort() mid = int((n - 1)/2) #change a[mid], a[n-1] = a[n-1], a[mid] st = mid + 1 ed = n - 2 #change while(st <= ed): a[st], a[ed] = a[ed], a[st] st = st + 1 ed = ed - 1 #change for i in range (n): if i == n-1: print(a[i]) else: print(a[i], end = ' ') return
Thank dkrakauer down the comment section!
Seems like cookies are disabled on this browser, please enable them to open this website
Zig Zag Sequence
You are viewing a single comment's thread. Return to all comments →
Make this exact changes to work properly in python3 otherwise it would not work irrespective of output being correct
Thank dkrakauer down the comment section!