I have given the following list
list = {a, {b, c, d, e}, {e, f, h, i}}
Is there a direct way to use Part
specification to get e.g. {a,b,e}
or {a,c,f}
. I know about Flatten
or Append
of course, but want to avoid it in my specific case.
Something like
list[[1, {{2, 1}, {3, 1}}]]
doesn't seem to work, unfortunately.
Extract[list, {{1}, {2, 1}, {3, 1}}]
yields{a,b,e}
. $\endgroup$X
". $\endgroup$