Maximum Sub-Array Sum (LeetCode 53) | Kadane's Algorithm | Study Algorithms

Veröffentlicht am: 25 Juni 2020
auf dem Kanal: Nikhil Lohia
28,207
545

Maximum sub-array is a programming challenge on LeetCode. You are provided with an array of integers. These elements could be all positive, all negative or a combination of both. A sub-array is a smaller array formed using the elements of the original array. The condition for this problem is that the elements of the sub-array should be contiguous. Out of all the contiguous sub-arrays possible we need to find the maximum sum that can be formed. Watch the video to understand the problem in a simplified manner. I then work along with you to solve it first using a Brute Force approach, and then an efficient approach. All along with visuals and explanations.

00:00 - Intro
00:29 - Problem Statement and Test Case
02:15 - Brute Force Method
04:15 - Optimized Solution
07:10 - Dry-run of code

📚 Links I talk about in the video:
Actual problem on LeetCode: https://leetcode.com/problems/maximum...
Code on Github: https://github.com/nikoo28/java-solut...
Test cases on GitHub: https://github.com/nikoo28/java-solut...

📘 A text based explanation is available at: https://studyalgorithms.com/array/max...

Kadane's algorithm: https://en.wikipedia.org/wiki/Maximum...

To see more videos like this, you can show your support on https://www.buymeacoffee.com/studyalg...

💻 Get Social 💻
Follow on Facebook at:   / studyalgos  
Follow on Twitter at:   / studyalgorithms  
Follow on Tumblr at:   / studyalgos  
Subscribe to RSS feeds: https://studyalgorithms.com/feed/

#leetcode #programming #interview


Auf dieser Seite können Sie das Online-Video Maximum Sub-Array Sum (LeetCode 53) | Kadane's Algorithm | Study Algorithms mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Nikhil Lohia 25 Juni 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 28,207 Mal angesehen und es wurde von 545 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!