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:
- For S = "aaaa", t = 1
- For S = "abcabc", t = 3
- For S = "abcdef", t = 6
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?
tis, if u repeat rotation bytit always ends up with the same string again. To increase the size oftyou also have to decrease the amount of repeated rotations bytuntil you receive the original string (all characters back at original position). That is3forhellohellohelloand2forhellohello. The next possible value is1, but that already gives youhellowitht = len(S). Hence, there is notin between.