title: Define a function that returns the number of non-overlapping occurrences of a sub string in a string
body: <p>Q> Suppose the count function for a string didn't exist. Define a function that returns the number of non-overlapping occurrences of a sub string in a string.</p>
  
  <p>I think this problem means that if I type the string <code>"abcd"</code> then the result is 10?</p>
  
  <p>I guess the substrings would be: </p>
  
  <pre><code>a
  b
  c
  d
  ab
  bc
  cd
  abc
  bcd
  abcd
  </code></pre>
  
  <p>So the result is 10. Is it right?</p>