title: Which algorithm to use to get longest string matching in two big arrays?
body: <p>The problem is easy to explain: we have two big arrays (32 bit integer values) and we have to find all common sequences above a given number of consecutive position (n).</p>
  
  <p>For instance, if n=3 and arrays to compare are:</p>
  
  <pre><code>a = [1, 3, 5, 7, 3, 2, 7, 4, 6, 7, 2, 1, 0, 4, 6]
  b = [2, 5, 7, 3, 2, 3, 4, 5, 6, 3, 2, 7, 4, 6, 0]
  </code></pre>
  
  <p>The algoritmh should return, two arrays:</p>
  
  <pre><code>r0 = [5, 7, 3, 2]
  r1 = [3, 2, 7, 4, 6]
  </code></pre>
  
  <p>(or better, its relative positions to first array and the number of consecutive bytes matched).</p>
  
  <p>I believe a good point to start is the <a href="http://en.wikipedia.org/wiki/Longest_common_substring_problem" rel="nofollow">Longest Common Substring Algorithm</a>, but perhaps anybody knows an algorithm that fits better or exactly with my problem.</p>