I have 2 lists. For example,
list1 = {{a,b}, {c, d}, {e, f}, {g, h}}
list2 = {{1}, {2}, {3}, {4}}
I want to merge them such that I get the result:
list3 = {{1,a,b}, {2,c, d}, {3,e, f}, {4,g, h}}
and the method generalizes to a large number of sublists.
How can one write a loop to execute this sequence of operations?
Flatten /@ Transpose[{list2, list1}]
good enough? $\endgroup$Join[list2, list1, 2]
:) $\endgroup$