title: Find max overlap in list of lists
body: <p>I have two lists of lists:</p>
  
  <pre><code>a = [[0, 1, 5], [2], [3], [4], [6, 7], [8, 9, 10, 11], [12], [13], [14], [15]]
  b = [[0, 1], [2, 3], [4], [5], [6, 7], [8, 9, 10, 11], [12], [13, 14], [15]]
  </code></pre>
  
  <p>How can I find the maximum overlap between the values of the lists and build a new list of lists with this maximum overlap.
  In other words, I'm looking for a function <code>f</code> which maximizes the list sizes by merging lists with overlap.</p>
  
  <p>The desired result of function <code>f</code> for this example would be:</p>
  
  <pre><code>f(a,b) = [[0, 1, 5], [2, 3], [4], [6, 7], [8, 9, 10, 11], [12], [13, 14], [15]] 
  </code></pre>