You are viewing a single comment's thread. Return to all comments →
My python solution:
def swap(arr): el = arr.pop(-1) arr.insert(0, el) return arr def circularArrayRotation(a, k, queries): for i in range(k%len(a)): a = swap(a) return [a[x] for x in queries]
Seems like cookies are disabled on this browser, please enable them to open this website
Circular Array Rotation
You are viewing a single comment's thread. Return to all comments →
My python solution: