Kadane Algorithm
Classic Problem: Finding the largest subarray
Explain: https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/
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
Last updated