2 added 81 characters in body
source | link

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
source | link

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}