I have a problem with the following task: having some nested list
list = {{k6},{k1,k3,k5},{k7}}
I would like to replace all sublists by their permutations and then split original list w.r.t. these permutations. So I started with permutations
list1 = {{{k6}},{{k1,k3,k5},{k1,k5,k3},{k3,k1,k5},{k3,k5,k1},{k5,k1,k3},{k5,k3,k1}},{{k7}}}
but I got stuck at this point - how to split this list w.r.t. sublists, i.e. to get:
list2 = {{{{k6}},{{k1,k3,k5}},{{k7}}},{{{k6}},{{k1,k5,k3}},{{k7}}},...}
Then I would like also to obtain a list of the form
{{k6,k1,k3,k5,k7},{k6,k1,k5,k3,k7},...}
Perhaps there is a simpler method to do this?
Obviously, if e.g.
list = {{k6},{k1,k3},{k2,k5},{k7}}
then the splitting should give list with all combinations of permutations of {k1,k3}
and {k2,k5}
taken into account preserving original order.
Flatten[]
with level consideration should solve it. $\endgroup$