title: Finding partial substrings within a string
body: <p>I have two strings which must be compared for similarity.  The algorithm must be designed to find the maximal similarity.  In this instance, the ordering matters, but intervening (or missing) characters do not.  Edit distance cannot be used in this case for various reasons.</p>
  
  <p>The situation is basically as follows:</p>
  
  <pre><code>string 1: ABCDEFG
  string 2: AFENBCDGRDLFG
  </code></pre>
  
  <p>the resulting algorithm would find the substrings <code>A</code>, <code>BCD</code>, <code>FG</code></p>
  
  <p>I currently have a recursive solution, but because this must be run on massive amounts of data, any improvements would be greatly appreciated</p>