Given a list, I want to find all possible ways to split it into sublists such that:
- Each sublist has length greater than 1.
- Any two consecutive sublists share exactly one common element.
- All elements of the original list are included in the sublists.
For example, for the input:
list = {1, 2, 3, 4, 5}; Some possible splits would be:
{{1, 2}, {2, 3}, {3, 4, 5}} {{1, 2}, {2, 3, 4, 5}} {{1, 2, 3}, {3, 4, 5}} ... {{1, 2, 3, 4, 5}}