I need your support, and you can do that by giving me a like, and commenting "understood" if I was able to explain you. Keeping a like target of 500 ❤️✌🏼
Believe me sir these lectures are sooo valuable that in upcoming days your like target will be crossing 100 times of what you expected...thank you so much ❤
I solved this problem all by myself, forming a recurrence relation and solving using recursion, updating it to memorization, and then converting the solution to tabulation and its space optimization. All of this without even starting the video, just by looking at the title and trying the problem by myself. Really grateful for your playlist, it follows a build-on-top approach, you take it from basics to advance, slowly increasing the complexity so the student doesn't get overwhelmed. Thank you
I couldn't believe that I have solved this question without watching this tutorial, It's all about striver's magic 🔥🔥 You have explained the lecture 8 so well that I've solved 9,10,11,12 by myself. Thank you sir ♥
Same here. I was so afraid of this topic but I could solve the problems even before watching the videos. I then watched the full video to understand the topic better and also for the space complexity and space optimization in the end
understood Sir .From DP Video 1 I was watching video in that mean time You suggested that At first complete at least lecture no 6 & 7 of recursion series .I paused then watched entire 19 videos of recursion series ,and then started watching this playlist And today in lecture no 12,I am able to build the logics slowly about the problem. Thanks Sir. I truly believe that whoever watching this lectures from beginning from the end of the series everyone can build logics on Dynamic Programming.
Finally after 12 videos I'm feeling lot more comfortable with DP still not able to come with solutions on my own but i don't have to watch more than once to understand concepts. Infact i was able to do memorization and tabulation on my own. Hope i can build recursion logic too by myself after watching few more videos.
It's unbelievable I solved this problem by myself after watching your previous videos. The quality of your teaching is top notch. Striver is really GOAT
I usually try to solve the problem mentioned in the video myself first then check Striver's intuition and solution of it. While searching for the problem of DP10 I accidently opened this problem(DP12) in CodingNinja website and started solving it. To my surprise, I was able to solve it and could build all the solutions by just following your steps. Thank you Striver! for teaching this concept in such a brilliant way. I was always afraid of DP as I could not get the intuition correct, but now I have gained a lot of confidence in it. You are indeed a GEM.
15:00 *TimeComplexity:* for the BruteForce: isn't it like below? Assume for a moment we have a single, hardcoded starting point, somewhere in the last row. From that, we'll be picking 3 paths, until we reach zero, so it's: 3^N. But then, we do this for every M column, right? So: *TC is: O(M (3^N))* *SC: O(N)* we go max N stack frames deep
solved the problem without even watching the tutorial and did recursion -> memoization -> tabulation -> space optimization all by myself🥺🥺 Thank you striver❤❤❤❤❤
understood. You did it from last so I had curiosity to do it from top to down in recursion and i did it. Because of you and the way you teach I can think of different approaches. Thank you striver bhaiya❤.
Very happy that I solved this question in all the formats except the space optimization, by just reading the question and given test cases. I still watched the whole video afterwards because I love listening to his explanations. You're doing a great job brother.
I just watched this video randomly after coming across this question and now the concept seems so interesting to me, that I am going to watch every video on dp and recursion of yours! Keep up the good work sir!
Sir, I was able to solve this question all by myself... This is the first question of the series which I was able to solve all by myself, without any reference/ hint anything .... still I cross checked my method with yours ... And I clearly understood. Thank you😊
Phle mai dp ko lekr bhut pareshan tha , Phir is DP ultimate Series ko dekhna shuru kiya, ab mai recursion se space optimisation tak phunch jata hoon. Thanks a ton @striver bhaiya 😎
I am very happy to share that I have solved this question where I wrote the recursion, memoization, tabulation and space optimization all by my own. Thankyou striver for your great explanation in the previous lectures.
Understood very well bhaiya...what u r doing is way way higher than liking,and commenting... may the good god bless u always, and u also get the same help from your senior ones as we are getting from you...thanks a lot. And ya, as u had in the first video of this series that,a t the end u'd feel that this is at a different level from other ,u indeed proved it as well.
Very nicely explained...I was able to solve this on my own bcs I had watched earlier videos of this series. One point which I wanted to make that instead of traversing the for loop to find max, we can check for condition of i == n in our first inner loop only and store the max value of last row....it will reduce extra for loop just to find the max value in last row...
Was able to code the memoization, tabulation AND the optimal solution on my own for this one after solving the triangle problem. All thanks to you Striver!
Understood man! I did this question without watching this video. I was able to come up with the plain recursive, memoization and tabulation all 3 methods.
Striver is Competing with himself only to provide more and more better content.....as soon as recursion tree gets over ... i am able to write all 3 approaches by my own. Thank you Striver...this is what your videos have done to me and many of us.... keep growing...
For recursive solution : TC should be 3^(N*M) ... coz for every cell I am exploring 3 different path , total cell is N*M , correct me if I am wrong ,SC is also N*M
I think correct TC for recursion will be O( M * (3^N) ): 3^N for the paths (as Striver mentioned) and M because of the for loop in which recursion is called. It will not be 3^(M*N) because it is not like that there are three options for every cell in the matrix but is more like there are M paths (starting from any cell of last row) and each path takes 3^N as each element in that path have three options. As for space complexity it will be O(N) as at any time the height of recursive tree will be N (number of rows) and only when stack frames of this call are deleted, recursion starting from next cell of last row called.
@@nashidnoormohammed4027 as Java is pass by reference so if we do prev = curr , prev will start pointing to curr , i.e. both curr and prev are now point to the same array any changes made will be reflected in both the array simultaneously. And hence the prev will not contain information of the previous row For faster operations instead of array.clone we can use system.arrray.copy method to copy the elements of curr to prev
This question came in IVP coderush this year (2023). It was about a random number generating machine which has layers and each layer has multiple nodes which can have three states 0, 1 and 2 which increase, keep same or decrease the number passed and you have to output the maximum value which can be obtained after going through all layers. And from each node you can only go to - the node directly below, bottom left and bottom right. I mean this question is happening.
Understood sir,NOW I AM ABLE TO WRITE RECURSION CODE AND RECURRENCE TREE BY MYSELF AND COVERSION TO MEMOIZATION AND TABULATION. THANKYOU FOR YOUR PREMIUM CONTENTS.
GUESS WHAT!!!! I solved it allll aloneeee!!!!!!!! Everything recursion, memoization, Tabulation and Space optimization!!!! STRIVER YOU ARE THE BESTTTTTTTTT!!!!!!!!!!!!!!!! BEST BEST BEST!!!!
thank u so much raj sir. today i solved the entire problem before watching the explanation. first recursion -> recursion +memoization -> tabulation -> tabulation with space optimization. thank u sir this entire process is wonderful to break a hard problem❣❣❣ and UNDERSTOOD 😁😁😁
I think, the Time Complexity of the recursive approach should be O(n*3^m) n -- no of columns. m -- No of Rows. For each cell in the last row, the recursive tree can grow up to 3^m.
It will be too easy for you if you follow the playlist from the starting. Try to listen him carefully notice him what he actually doing to solve the problem. Thank you sir for this amazing playlist
Bhaiya 2-D dp ka first video dekha aapka and guess what,baki sare videos ke questions khud se hi solve ho rahe the....this is the strength of your qualilty content bhaiya.Keep it up,God bless you.
Wow before watching the Video the solution came to my mind. seeing the same solution being explained in the video is awsm. Thanks for great explanation.