dsa1 min read
Maximum Subarray — Kadane's Algorithm
Find the contiguous subarray with the largest sum. Kadane's algorithm: either extend previous subarray or start fresh at current element.
Read →
webcoderspeed.com
2 articles
Find the contiguous subarray with the largest sum. Kadane's algorithm: either extend previous subarray or start fresh at current element.
Find maximum product of a contiguous subarray. Track both min and max at each position because a negative * negative becomes positive.