Mental Model
Find the largest sum of a continuous part of the list by keeping track of the best sum ending at each position.
Analogy: Imagine walking along a path with ups and downs in height. You want to find the highest hill you can climb without going back, by deciding at each step whether to continue climbing or start fresh from that point.
Array: [ -2, 1, -3, 4, -1, 2, 1, -5, 4 ] Index: 0 1 2 3 4 5 6 7 8