Kadane's Algorithm and Prefix Sum Tricks
Find the best contiguous subarray without checking every one, using a habit of thought you will reuse in dozens of problems.
8 min readUpdated 2026-09-03arrayskadaneprefix-sum
Find the best contiguous subarray without checking every one, using a habit of thought you will reuse in dozens of problems.