Best run in one pass.
transcript
Nine days of revenue change. Some days are negative. Find the best run. Two numbers do it. Revenue goes up and down. The best stretch is hidden in it.
Five starts the first run. Minus nine makes it minus four. A negative run only hurts. So four starts again. Each day asks the same question. Is the run so far worth keeping?
Six makes ten. Minus three makes seven. Seven makes fourteen. Best so far keeps fourteen. Later days never beat it. The notebook only ever goes up. Best here can fall. Best so far cannot.
Best here ends at this place. Best so far is the largest seen. It is the answer. Start both from the first value. One pass. Two numbers. Extend while the run helps. Start again when it hurts. The pass costs one step per day. No run is ever stored.
Best here. Best so far. Full breakdown in the lecture.