Overview
Kadane's Algorithm solves the Maximum Subarray Problem in linear O(n) time using dynamic programming. At each index i, it decides whether to extend the best subarray ending at i - 1 or start a fresh subarray at i, tracking both the maximum sum and the [start, end] index boundaries.