title: Finding the longest common subsequence in a variable amount of sets with no repeating characters?
body: <p>I'm trying to come up with an efficient algorithm that would work in JavaScript for the <a href="http://en.wikipedia.org/wiki/Longest-common_subsequence_problem" rel="nofollow">longest common subsequence problem</a>. However, there are two main differences between my problem and the one described in the Wikipedia article. The first is that I will have more than two sets of characters. The second is that characters will never repeat in a set. This means that the length of each set will be at most about 50 characters (i.e. the printable ASCII chars).</p>
  
  <p>For example, the sets may contain:</p>
  
  <pre><code>A = ZBANICOT
  B = ACNTBZIO
  C = ANICOTZB
  D = ZIANCOTB
  </code></pre>
  
  <p>... and it should output <code>ACO</code>, <code>ACT</code>, <code>ANO</code>, and <code>ANT</code>, since these are the longest subsequences in all 4 sets (as far as I can tell from manually examining these sets).</p>
  
  <p>Since none of the letters repeat, is there a more efficient algorithm I should consider rather than the one described in the Wikipedia article? If not, is there anywhere that describes how to convert the algorithm to having N sets instead of 2?</p>