0

Move to Right and left
Task
Your task is to Move Right and left. If the numbers combine, sum.
Example
[1, 2]
/\ /\
/ X \
[1, 2, 1, 2]
Another example
[1, 2, 3]
/\ /\ /\
/ X X \
[1, 2,\/ \ \
4, 2, 3]
Test cases
[1,2,3] => [1,2,4,2,3]
[4,2] => [4,2,4,2]
[1] => [1,0,1]...