You are viewing a single comment's thread. Return to all comments →
I think 'k' should be allowed to be greater than 'n'':
def array_left_rotation(a, n, k): d = k % n ret_arr = a[d:] ret_arr.extend(a[:d]) return ret_arr def array_left_rotation(a, k): d = k % len(a) return a[d:] + a[:d]
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays: Left Rotation
You are viewing a single comment's thread. Return to all comments →
I think 'k' should be allowed to be greater than 'n'':