Maximum Product Subarray - Best Intuitive Approach Discussed
Vložit
- čas přidán 23. 07. 2024
- Problem Link: bit.ly/3VPdyyq
Notes/C++/Java/Python codes: takeuforward.org/data-structu...
We have solved the problem, and we have gone from brute force and ended with the most optimal solution. Every approach's code has been written in the video itself. Also, we have covered the algorithm with intuition.
Full Course: bit.ly/tufA2ZYt
You can follow me across social media, all my handles are below:
Linkedin/Instagram/Telegram: linktr.ee/takeUforward
0:00 Introduction of Course
He is a real competitive programmer in all CZcamsrs who teaches DSA in India
guys who do cp have better problem solving skills, even doing dsa gives but cp just opens the brain to think in diff solutions
I had never seen this approach and the way you explain is like you own it.!!!
Superb work striver bro
;)
In leetcode take double for suffix,prefix and return value .so the last test case not gonna be int overflow
double maxPro = Integer.MIN_VALUE;
double pre = 1, suff = 1;
int len = nums.length;
for(int i=0; i
@@sumeetsinghaaryan why is it working for double but shows overflow error when using long?
@@shishirkarki9001 i also didnt get it ?
@@VISHALTHAKUR-gg3dg i came to know that double has larger range than long
I was literally searching for the intuitive approach and finally found it.. really appreciate it..
and a great explanation..
Completed this playlist also, MAN this is the best teacher of DSA. UNDERSTOOD!!!!!!!
Brilliant! this is actually much more intuitive as I was also thinking of applying prefix and suffix in it, just couldn't react to the final answer.
Thanks.
This approach is awesome! I've seen others teaching the same old Kadane approach, but this observation-based method is a real gem. Keep up the great work and keep sharing your insights!
You're God sent for us to learn in last moment ❤
bro no need any more examples you were the best in explaining this question with the most examples the cases...
Really understood the concept very well. Thank you for the video...
Arrays completed
Tomorrow I will revise full arrays before starting binary search
Understood! Super awesome explanation as always, thank you very very very much for your effort!!
The way he did it in one go without taking separate arrays before and after 0 like I did.. hatsoff you are truly amazing!
Was struggling to understand the explanation of this problem, but after tour video I am amazed how easy it is :D
Had to give this a like, can't lie the best explanation for this problem.
Happy to see your video. So many videos I watched for this question. Finally i can get the intutive for the question.
Best Solution , will never forget this solution .
You learn something new everyday ❤. This is the reason I love your videos. Got to learn something new.
Hey Striver can you add the famous Egg Dropping Problem in your DP series? It will be of great help to many students.
I do not know who has observed the optimal approach but whoever the guy was, it was brilliant
Thanks for your explanation Striver
Understood it very well
And waiting for your Binary Search series...
Best explanation ever i have seen for this. Thank you bro 🙏
I actually understand this and it makes so much sense. Thanks!
Best explanations and best qualities. You are a striver indeed.
Thankyou Bro❤ I have Huge of respect and Thankfulness for you 🎉you are doing such a great thing ❤❤
Completed this playlist.... Gain confidence and knowledge.... Thank you Bhaiya ❤❤
The way he explained made me to think how to really approach a problem with logical thinking...Great Striver!!!
How can you help me please
Thanks for the great explanation, it feels like you are explaining me one to one the way you place your face on the screen!!
u just fired it man.....what an awesome explanation....Thanks bro for the help.
Thanks for the great playlists for DSA
Bhai mast video thi. Teeno algo's samajh mein aa gyin.
awesome teaching and please teach every problem how to identify the pattern which algo we need to used.. and try to explain all the approaches. by the way your videos are great you will deserve 1m soon.
finally array completed..thanks striver bhaiya
Just a small change in the code for those who are wondering why 191th test case is not passing on leetcode, just change the data type of ans, pre and suff to double so as to prevent overflow in the intermediate steps. It has much bigger range than long and long long. Btw great explaination striver!!
Thank You So Much for this wonderful video.......................🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
superb and easy to understand explanation !
you are really the best teacher available on youtube
UNDERSTOOD.............Thanks a ton............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
the optimal solution, too good and intuitive as you saidd!!!
Nice Explanation and intuition for this problem.. Thanks a million Striver. ♥♥♥
Just another level 🔥
I think the super clean implementation was very nice.
very nice video, Just like a story. Thanks.
great
the best approach i have ever seen
This approach is excellent.
Completed Arrays on 09/05/24 ..Superb Content and Explanation .....
mind blowing approach
i generally dont comment on videos , but yaar striver truly is a genius
Great Approach!
Good explanation and much intuitive
I have watched the solution of neetcode and i must admit that you solution is very intuitive 😂
excellent explanation striver!
excellent approach !!
really great explaination !!!
Hey Brother..At first thank you for your great work..Now I am learning Recursion from your recursion playlist..Love you from Bangladesh
Really needed this
im so happy that i did this prblm both brute and optimal by myself....only difference in my code was i did traversal two times to calc prefix and suffix😅. BTW THANKS STRIVER YOU ARE GREAT🙇
The logical thinking It's very easy to understand.. with TC -> O(N) and SC -> O(1)
Understood striver much love to you
Huge respect brother♥
Very well explained 👏
Areh Dada ,,, watta approach
THANK YOU SO MUCH...VERY HELPFUL BRO.......
Hi striver, first of all this is the best video that i have seen till now for this problem. Secondly, don't you think this is kadanes algorithm only. We did the same thing like adding all the elements till the end and when we got a negative element will turned that to 0. But this time we are doing from both the sides....
best explanation sir 😁😁
Hello, thank you for the awesome explanation. Wondering what tool are you using for electronic drawing?
This Guy is Next Level
Understood, thank you.
Great solution
This was a good one!!
ek number solution!!
what an approach sir
U jus explained the problem in a way it was made simple
Yes when I first saw the solution with kadanes it made me depressed fr, but this approach I will never forget
Understood Bhaiya!!
Great approach
Thank you bhaiya 🙂
Nice solution
UNDERSTOOD 🔥🔥🔥🔥
That is an awesome presentation tool. Can you tell me which tool you used for this?
Understood✅🔥🔥
bro you are genius!!!!
I have solved this problem before, but still I would like to know your approach on this
Amazing ❤
Damn !!! That was good .
Thanks Bhaiya!!
Thank you!!
amazing explanation just amaze with the approach
bro is this array playlist good?
@@PDSREACTION Not only array but all the playlists brothers without any doubt
wow just amazing
What an explanation
Thanks Brother💌
After your hinting, I got the approach...but then I realized ,if we have 0s, then what to do
Understood😊
Understood!!!!!❤
Understood ❤️
nice one sir
Helpful ❤
Thank you bhaiya
simply GOAT
bro how can i thank you enough ? ❤❤❤
U r a legend ❤❤
Understood!
thank you!!