Kadane Algorithm
Last updated
Last updated
Classic Problem: Finding the largest subarray
Explain:
Leetcode
=> PATTERN: Remember this code
Enhancement: Now we have maximum subarray. Now Calculate maximum subsequence from this subarray.
For example: The subarray [2, -1, 2, 3, 4] is the subarray with the maximum sum, and [2, 2, 3, 4] is the subsequence with the maximum sum.
=> PATTERN: Remember this code
ADVANCE: Find that subarray
=> Remember this code