I have a nested list:
{{{1, 2, 3, 4, 5, 6}}, {{1}, {2, 3, 4, 5, 6}}, {{1, 2}, {3}, {4, 5, 6}}}
and would like to select only those lists out of it with two items in it:
{{{1}, {2, 3, 4, 5, 6}}}
How could this be achieved?
data = {{{1, 2, 3, 4, 5, 6}}, {{1}, {2, 3, 4, 5, 6}}, {{1, 2}, {3}, {4, 5, 6}}};
Select[data, Length @ # == 2 &]
{{{1}, {2, 3, 4, 5, 6}}}
Select[lst, Length@# == 2 &]
(see Select) $\endgroup$Cases[lst,{_,_}]
$\endgroup$Select[EqualTo[2]@*Length][data]
$\endgroup$