An all-negative list is the trap.
transcript
Every value is negative. Minus five, minus two, minus nine. What is the best run? Watch the start value. It looks like an easy case. It is the classic trap.
This version starts both numbers at zero. Nothing ever beats zero. It returns zero. But no run sums to zero. A test with only gains hides this. Real data has bad weeks.
Start from the first value. Minus two beats minus five. Minus nine does not. The answer is minus two. Every run has at least one value. So the first value is the start. Both numbers begin there.
Every run has at least one value. So start from the first value. Never start from zero. Test every list of losses. Zero is a trap. A returned zero hides the bug. Test one value. Test all negative. Then trust the loop.
Start from the first value. Full breakdown in the lecture.