A negative running sum only drags down what comes after it. On 8, -19, 5, -4, 20 the best run keeps the -4 and drops the 8: 21. Extend or start fresh, one pass.

A negative running sum only drags down what comes after it. On 8, -19, 5, -4, 20 the best run keeps the -4 and drops the 8: 21. Extend or start fresh, one pass.