Maximum Subarray - Leetcode 53

preview_player
Показать описание
Today we will solve the "Maximum Subarray" problem from Leetcode. We will walk through brute-force and then A dynamic programming solution to solve this problem.

This question has been asked by Google, Meta, Amazon, Apple, Microsoft, and so many other companies.

Please check the channel page for more leetcode solution videos. Also don't forget to like, comment, and subscribe.
Hope you enjoy the video and Thanks for watching 🙏

Chapters:
0:00 Intro and question
0:04 Examples
0:39 Broute-force solution
0:49 What could go wrong?
1:11 DP Solution
3:34 DP code walkthrough
5:06 Time and Space Complexity
Рекомендации по теме
Комментарии
Автор

First off really great video

But second
Would a two pointer solution work

Where you store the sum of array and two pointers one at begin and one at end

Then move the pointer with the lower value and adjust sum accordingly.

Finally returning the max value?

sonicrushXII