[Solved] python about linking sublist with same number together
To group the sublists in a general way you can: Code: def linking_sublists(lists): index = {} sets = [] for l in lists: found = None for i in l: if i in index: # this list has an element we have already seen if found: # combine two sets to_remove = index[i] if found … Read more