Maximum Subarray (Kadane)

Jay Kadane, 1984

O(n)

Jay Kadane’s lecture DP (typically dated to 1984) compares cumulative extension with restarting at nums[i]; it is the quintessential “state = best ending here” recurrence. Bars stay muted slate, gold marks the tentative suffix, teal freezes the incumbent champion when the sweep finishes, coral spells the payoff—mirroring muted palette guidance while keeping readability high.