You are viewing a single comment's thread. Return to all comments →
Python two solutions #Python
def rotateLeft(d, arr): n = len(arr) rarr = [0] * n for i in range(d, n): rarr[i-d] = arr[i] for j in range(d): rarr[n-d+j] = arr[j] print(rarr) return rarr #second solution def rotateLeft(d, arr): return arr[d:] + arr[:d]
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
Python two solutions #Python