number of distinct rotations of a string How do we count the number of distinct rotations of string ?
string s="ABCD" has four distinct rotations "ABCD", "BCDA", "CDAB" and "DABC" but 
ABAB" has only 2: "ABAB" and "BABA". More so, a string like "BBBB" has only 1 rotation.

*

*If the given string consists of only one character(like "aaa", "bb", "ccccc", etc.), then the number of distinct rotations is equal to one.

*If the given string is of the form (S1)^K (repetition of a string "S1" K times, example "abab", "abcabc", "abcdabcdabcd"), then the number of distinct rotations is equal to the length of the string S1. (Note: The string S1 should be selected such that from multiple options, its length should be the smallest.
For example, for the string abababab, the sub string S1 is ab and not abab.)

*In all the remaining cases, the number of distinct rotations is equal to the length of the given string.

