Pattern 22: LeetCode Interview Patterns24 sections · 736 units
Open in CourseQuiz: Kadane's Decision
Test your understanding
Check Your Understanding
At each position, Kadane's algorithm decides: extend the previous subarray or start fresh. When should you start fresh?
- A.When current element is negative
- B.When current element is larger than the sum so far
- C.When you've processed half the array
- D.When the running sum becomes negative