We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

Keep in mind a left rotation of x is equal to (len-x) of righ rotations. Hence, it would be more efficient to the rotation with least amount of "moves".

## Left Rotation

You are viewing a single comment's thread. Return to all comments →

how did u solve??

Keep in mind a left rotation of x is equal to (len-x) of righ rotations. Hence, it would be more efficient to the rotation with least amount of "moves".

Thats true. I got accepted for test case 8 using right rotation. We need to choose :

If #rotations < (size /2) Use Left Rotation If #rotations > (size /2) Use Right Rotation

can you elaborate @crystalcode