I have previously published an article on max/min subarray sum problem using Sliding Window technique. Now it is time to one-up it with Kadane's Algorithm, which also handled arrays with negative numbers. It is slightly more complex than Sliding Windows Technique but it is a frequent ingredient of many programming interview questions. It is also a prime example of Dynamic Programming.
- You can find the full writeup here: https://quanticdev.com/algorithms/dynamic-programming/kadanes-algorithm
- If you prefer a video instead: https://www.youtube.com/watch?v=4csAswCkXZM
Top comments (0)