This is a shitty explanation, it explains how to memorize the algorithm. Instead of explaining why it even does that. Why do we use gcd.
Hi laasya, great explanation. Can you give little more intuition into why GCD times? how exactly GCD justifies it..
Nice, You have explained this so well :)
Tharun Reddy
#123tharun
Sai Laasya Vabilisetty
Thank you for the great explanation. Consider an array [1,2,3] which needs to be rotated right by 3. In this case k=4 and k is going to be 3-4 i.e n-k. Does n-k work in all the cases?