• + 0 comments

    If rotation is greater than the length of the string, this line gets used. Say we have 5 as the length of the string. If the rotation given as 7, it is actually 2 and hence 7%5 == 2. If you're still unsure, try the above scenario and see how this line helps :)