Let's say we have a list of lists:
list = [[a],[b],[c],[d],[e],[f],[g],[h]]
Now I am looking to generate all possible combinations of 2 by 3, so that one possible combination would be:
[[[a],[b],[c]], [[d],[e],[f]]]
and another would be:
[[[g],[h],[c]], [[d],[e],[f]]]
or
[[[a],[b],[f]], [[d],[e],[c]]]
The order does not matter at any level. However, elements must not repeat, meaning the following list would be incorrect, and should not be generated:
[[[a],[b],[f]], [[a],[e],[f]]]
Similarly
[[a,b,c], [e,f,c]] and [[e,f,c], [a,b,c]]
would be the same thing, and should only appear once.
I have fried quite a few nerve cells, but have been unable to produce a working solution. I am using Python to solve this problem.