Finding all possible combination of all possible subsets of lists
问题 I am trying to find all combinations of subsets of from a list, where each element is used only once. To clarify what I mean, given an example list of: [1, 2, 3, 4] I can generate, the following combinations: [(1), (2), (3), (1, 2), (1, 3), (2, 3), (1, 2, 3)] (this should be exhaustive!) Then I can generate combinations of these combinations: [[(1), (2), (3)], [(1, 2), (3)], [(1, 3), (2)], [(1), (2, 3)],[(1, 2, 3)],... (for many)] The main point is that I am only allowed to use each element