Jelly, 5 bytes
0;+μ/
How it works
0;+μ/ Main link. Argument: M (matrix / array of rows)
μ Combine all links to the left into a chain (arity unknown at parse time) and
begin a new monadic chain.
/ Reduce M by that chain. This makes the chain dyadic.
Let's call the arguments of the chain L and R (both flat arrays).
0; Prepend a 0 to L.
+ Perform element-wise addition of the result and R.
Since When the chain is called for the n-th time, R has onen less elementelements, so
the last elementn elements of L won't have a matching elements in R and will be
element in R and will be left unaltered.
Jelly, 5 bytes
0;+μ/
How it works
0;+μ/ Main link. Argument: M (matrix / array of rows)
μ Combine all links to the left into a chain (arity unknown at parse time) and
begin a new monadic chain.
/ Reduce M by that chain. This makes the chain dyadic.
Let's call the arguments of the chain L and R (both flat arrays).
0; Prepend a 0 to L.
+ Perform element-wise addition of the result and R.
Since R has one less element, the last element of L won't have a matching element in R and will be left unaltered.
Jelly, 5 bytes
0;+μ/
How it works
0;+μ/ Main link. Argument: M (matrix / array of rows)
μ Combine all links to the left into a chain (arity unknown at parse time) and
begin a new monadic chain.
/ Reduce M by that chain. This makes the chain dyadic.
Let's call the arguments of the chain L and R (both flat arrays).
0; Prepend a 0 to L.
+ Perform element-wise addition of the result and R.
When the chain is called for the n-th time, R has n less elements, so
the last n elements of L won't have matching elements in R and will be
left unaltered.
Jelly, 5 bytes
0;+μ/
How it works
0;+μ/ Main link. Argument: M (matrix / array of rows)
μ Combine all links to the left into a chain (arity unknown at parse time) and
begin a new monadic chain.
/ Reduce M by that chain. This makes the chain dyadic.
Let's call the arguments of the chain L and R (both flat arrays).
0; Prepend a 0 to L.
+ Perform element-wise addition of the result and R.
Since R has one less element, the last element of L won't have a matching
element in R and will be left unaltered.
Jelly, 5 bytes
0;+μ/
How it works
0;+μ/ Main link. Argument: M (matrix / array of rows)
μ Combine all links to the left into a chain (arity unknown at parse time) and
begin a new monadic chain.
/ Reduce M by that chain. This makes the chain dyadic.
Let's call the arguments of the chain L and R (both flat arrays).
0; Prepend a 0 to L.
+ Perform element-wise addition of the result and R.
Since R has one less element, the last element of L won't have a matching
element in R and will be left unaltered.