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 remembering the best climb so far and deciding if starting fresh is better.
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 track sums as we move ->
