Let's say we are rotating a string one at a time ("abcd" -> "bcda"). After some t rotations we get the same string. Let t be the minimum such number of rotations.
For ex:
Now my question is, can there be any string for which this condition holds : t > len(S)/2 and t < len(S)? If not can you please explain why?
Let's assume you can rotate your string t times and it will be the same string. Then if you rotate it another len(S)-t times you will definitely get the same string. If we assume that t>len(S)/2
we straightforwardly get that len(S)-t<len(S)/2
, so minimal rotation is always <=len(S)/2