You are viewing a single comment's thread. Return to all comments →
def reverseArray(a): left = 0 right = len(a)-1
while right > left: a[left], a[right] = a[right],a[left] left += 1 right -= 1
return a
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays - DS
You are viewing a single comment's thread. Return to all comments →
def reverseArray(a): left = 0 right = len(a)-1
return a