I have two lists of lists:
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]]
How to find the maximum match between the list values ββand build a new list of lists with this maximum overlap. In other words, I'm looking for a function fthat maximizes list sizes by combining lists with overlapping.
The desired function result ffor this example:
f(a,b) = [[0, 1, 5], [2, 3], [4], [6, 7], [8, 9, 10, 11], [12], [13, 14], [15]]