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 start fresh or continue climbing.
Array: [ -2, 1, -3, 4, -1, 2, 1, -5, 4 ] Index: 0 1 2 3 4 5 6 7 8 max_ending_here and max_so_far start at first element -2
