Hey
How could I get all combination of the given list where each item in the list is a tuple and the combination should be made based on the second element. The second element is a list containing minium one and maximum four atoms.
Input:
[
{{1, 1}, [:w, :e]},
{{1, 3}, [:e]},
{{2, 3}, [:n, :s]}
]
Output:
[
[
{{1, 1}, [:w]},
{{1, 3}, [:e]},
{{2, 3}, [:n]}
],
[
{{1, 1}, [:w]},
{{1, 3}, [:e]},
{{2, 3}, [:s]}
],
[
{{1, 1}, [:e]},
{{1, 3}, [:e]},
{{2, 3}, [:n]}
],
[
{{1, 1}, [:e]},
{{1, 3}, [:e]},
{{2, 3}, [:s]}
]
]
edit:
- its a subtask of a homework i encountered, so i cannot provide a source
- ive read the first ~10 chapters of this guide