title: Find common sequence of elements in list of lists
body: <p>I have list of lists containing Id's as following-</p>
  <pre><code>[[45, 41, 20, 25, 78],
   [54, 12, 45, 36, 59],
   [45, 12, 45, 41, 88],
   [74, 85, 41, 20, 25],
   [54, 45, 36, 59],
   [74, 20, 25]]
  </code></pre>
  <p>Problem 1: I need all the  lists having same prefix(list starting with same number) in one list.
  Desired output</p>
  <pre><code>[[45, 41, 20, 25, 78],
   [45, 12, 45, 41, 88]]
  [[54, 12, 45, 36, 59],
   [54, 45, 36, 59]]
  [[74, 85, 41, 20, 25],
   [74, 20, 25]]
  </code></pre>
  <p>Problem 2: Later find the common elements in respective sub-lists. For example:</p>
  <pre><code>   [[45, 41, 20, 25, 78],
     [45, 12, 45, 41, 88]]
  </code></pre>
  <p>In this list common elements are [45,41]</p>
  <p>Final desired output:</p>
  <pre><code>[[45, 41],
   [54, 45, 36, 59],
   [74, 20, 25]]
  </code></pre>