For Example:
[[1, 2, 3], [2], [1, 2, 3], [5, 6]]
Will generate:
[[1, 2, 3, 5], [1, 2, 3, 6], [3, 2, 1, 5], [3, 2, 1, 6]]
Any lists containing 2 of the same elements are not allowed: i.e [2, 2, 3, 5]
I've tried using itertools.product(*list)
to generate a list of all possible combinations and then looking through that list for any lists with duplicates in it, but this is far too cost intensive for my purposes. Anyone got any ideas?