0

There is nested list for input as an argument to the function like:

id_list = [[1, 2], [2, 3], [10, 214], [214, 207], [1082, 207], [892, 398].........]

Every pair inside list is let's say interconnected with each other. So in id_list when we have [1,2] and [2,3] that means that 1 and 3 also interconnected because they both have 2 in nested lists. There can be many different interconnections and the result should be the tuples which include all interconnected numbers:

(1, 2, 3), (10, 214, 1082, 207), ...
listing
  • 1
  • 2

0 Answers0