title: Longest Common Subsequence for Multiple Sequences
body: <p>I have done a bunch of research for finding the longest for M = 2 sequences, but I am trying to figure out how to do it for M ≥ 2 sequences</p>
  
  <p>I am being given N and M: M sequences, with N unique elements. N is the set of {1 - N}. I have thought about the dynamic programming approach, but I am still confused as to how to actually incorporate it.</p>
  
  <p><strong>Example input</strong>  </p>
  
  <pre><code>5 3
  5 3 4 1 2
  2 5 4 3 1
  5 2 3 1 4
  </code></pre>
  
  <p>The max sequence here can be seen to be  </p>
  
  <pre><code>5 3 1
  </code></pre>
  
  <p><strong>Expected output</strong>  </p>
  
  <pre><code>Length = 3
  </code></pre>