Last updated 4 years ago
Divide the array in different sets where number of sets is equal to GCD of len and number of rotation and move the elements within sets.
This algorithm works for left rotation of array.
Example of len =12 and rotate = 3. GCD is 3