depth

Running total

Return the running total of a list.

f 1 2 3 4

should return 1 3 6 10.

Hint

Look for a built-in whose name is the plural of sum.

Solution

f:{sums x}

sums returns the cumulative sum at each position.

Answer

f:{sums x}