You are viewing a single comment's thread. Return to all comments →
I think there is no need of any maths or what you did. Well what i do is down below, more simple and works for all test cases.
#a = given_array #d = given number of left rotations to be done b = [] b.append(a[d:]) b.append(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 there is no need of any maths or what you did. Well what i do is down below, more simple and works for all test cases.