ArraysEvidence Contributing
Kadane's Algorithm
Track the best subarray sum ending at the current index, resetting to zero whenever the running sum turns negative.
Practice Problems: 2
Difficulty: 0 Easy·2 Medium·0 Hard
Core technique
Review the technique, then try the mapped problems below. The right approach depends on each problem's constraints.
- Core Strategy: Track the best subarray sum ending at the current index, resetting to zero whenever the running sum turns negative.