2 added 81 characters in body edited Feb 11 at 17:59 Roman 15.9k11 gold badge2121 silver badges5454 bronze badges You can use a multiplication instead of looping or conditionals: list1 + (1 - list1) Prepend[Most[list2], 0]  {0, 1, 1, 4, 7, 1, 1, 10, 1, 11, 3, 1, 0} The central point is that 0 and 1 in list1 aren't just symbols but numeric quantities. You can use a multiplication instead of looping or conditionals: list1 + (1 - list1) Prepend[Most[list2], 0]  {0, 1, 1, 4, 7, 1, 1, 10, 1, 11, 3, 1, 0} You can use a multiplication instead of looping or conditionals: list1 + (1 - list1) Prepend[Most[list2], 0]  {0, 1, 1, 4, 7, 1, 1, 10, 1, 11, 3, 1, 0} The central point is that 0 and 1 in list1 aren't just symbols but numeric quantities. 1 answered Feb 11 at 17:32 Roman 15.9k11 gold badge2121 silver badges5454 bronze badges You can use a multiplication instead of looping or conditionals: list1 + (1 - list1) Prepend[Most[list2], 0]  {0, 1, 1, 4, 7, 1, 1, 10, 1, 11, 3, 1, 0}