title: Longest Common Prefix Array
body: <p>Following is the <code>Suffix array</code> and <code>LCP array</code> information for string <code>MISSISSIPPI</code>. I know that <code>LCP</code> gives information about the lenght of the longest common prefix between <code>str[i - 1]</code> and <code>str[i]</code>. How Do I get longest common prefix length between any two arbitrary suffixes of this string. For example, I want longest common prefix between <code>MISSISSIPPI</code> and <code>ISSIPPI</code></p>
  
  <pre><code>SA  LCP
  12  0     $
  11  0     I$
  8   1     IPPI$
  5   1     ISSIPPI$
  2   4     ISSISSIPPI$
  1   0     MISSISSIPPI$
  10  0     PI$
  9   1     PPI$
  7   0     SIPPI$
  4   2     SISSIPPI$
  6   1     SSIPPI$
  3   3     SSISSIPPI$
  </code></pre>