I'm trying to figure out how to compare n number of lists to find the common link among the lists. For example following are the lists:
A = [1,2,3],
B = [3,4,5,6],
C = [6,7,8],
D = [4,5,6],
..
..
The input to this program will be A and C (looking for a way to find a common link between A & C)
The expected output is
C-->B-->A (A & C are linked through B)
The challenge might be find deeper level of connections e.g.
A = [1,2,3],
B = [3,4,5,6],
C = [6,7,8],
D = [8,9,10],
E = [10,11,12] ..
..
The input to this program will be A and E (looking for a way to find a common link between A & E)
The expected output is
E-->D-->C-->B-->A (A & E are linked through D,C,B)
I've looked at this solution that compares two lists but it is solving a very different problem: How to find common elements in list of lists?