title: Find the number of occurrences of a subsequence in a string
body: <p>For example, let the string be the first 10 digits of pi, <code>3141592653</code>, and the subsequence be <code>123</code>. Note that the sequence occurs twice:</p>
  
  <pre><code>3141592653
   1    2  3
     1  2  3
  </code></pre>
  
  <p>This was an interview question that I couldn't answer and I can't think of an efficient algorithm and it's bugging me. I feel like it should be possible to do with a simple regex, but ones like <code>1.*2.*3</code> don't return every subsequence. My naive implementation in Python (count the 3's for each 2 after each 1) has been running for an hour and it's not done.</p>