I have a problem with nested lists. For example, i have this list:
solution = {{{{{18, 11, 8}, {17, 12, 2}}, {{17, 12, 11}, {18, 8, 2}}}, {{{{17, 11, 8}, {18, 12, 2}}, {{18, 12, 8}, {17, 11, 2}}}, {{18, 12, 11}, {17, 8, 2}}}}, {{18, 17}, {12, 11, 8, 2}}}
I would like to simplify this nested list into list of lists:
simplified = {{{18, 11, 8}, {17, 12, 2}} , {{17, 12, 11}, {18, 8, 2}}, ...}
How can it be done? I used some ArrayFlatten
, but this didn't help me.
Thank you for solution, i am trying to understand this language.
Nest
you can addFlatten
to avoid too many {}, rewrite your oiginal code. $\endgroup$Flatten[solution, 2]
$\endgroup$