1
$\begingroup$

I have a basic question about list-manipulation. I have two lists:

l1 = {{1, 1}, {2, 2}, {3, 3}}
l2 = {a, b, c}

The desired outcome is: {{a,1,1},{b,2,2},{c,3,3}}

I tried with Transpose but didn't get it to work; any suggestions?

$\endgroup$
0

1 Answer 1

3
$\begingroup$
MapThread[Prepend, {l1, l2}]

or

Flatten /@ Transpose[{l1, l2}]
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.