
Kadane's Algorithm (Maximum Subarray)
At each index, extend the running sum or start fresh — that's Kadane's. Here's a full guide: intuition, when to use it, walkthroughs, pitfalls, and code — from O(n²) brute force down to O(n) with O(1) space.
26 min read