title: Number of distinct rotated strings
body: <p>We have a string <strong>S</strong> and we want to calculate the number of distinct strings that can be formed by rotating the string.</p>
  
  <p>For example :-</p>
  
  <p><strong>S = "aaaa"</strong> , here it would be 1 string {<strong>"aaaa"</strong>}</p>
  
  <p><strong>S = "abab"</strong> , here it would be 2 strings {<strong>"abab"</strong> , <strong>"baba"</strong>}</p>
  
  <p>So ,is there an algorithm to solve this in O(|S|) complexity where |S| is the length of string.</p>