I have watched NeetCode, CS Dojo and Kevin Naughton's explanation but couldn't understand the concept behind arr[target] = arr[target-1] + arr[target-2] for this problem until I came across your "How to understand and attack" segment. Thank you for explaining like I'm 5.
Man great breakdown. I'm doing interview prep by grinding on leetcode and your videos have been a great way for me to understand how to solve set problems. You do a great job of talking slowly but not too slow and breaking the problem down that is simple to understand.
really loving this DP playlist! I havent seen any other playlist on DP on youtube that is so easy to understand yet effective. You are an amazing teacher Nikhil! 🙏
I wish you could have been my teacher for dsa! You are a true teacher, this was so simple to follow I want to cry. Thank you so much sir! Please keep making this type of videos they are life savers for people like me! Thank you thank you! Please could you touch upon recursion and tree problems please !
Thank you so much for your kind words. I do have videos on recursion and tree problems. Check out my playlist on algorithmic paradigms. :) I hope they are helpful too.
Bcz index starts at 0 if you want to calculate the 8 step you need ans of 8th index but if u pick array of size n you would be providing ans of 7th index instead of 8@@santoshibora1892
@@santoshibora1892 because you need to store all the number of ways for each position of n, that's for memo in that case example dp[0,1,2,3,5,8,13] so if you need to get the max of the steps for n = 13 you go to the dp and return that exactly value.
best explanation...very few people know about this channel , iam sure if you keep on doing such amazing work , iam sure more and more people will get benefitted by your videos
The way you explained it made it so easy to understand. Thank you, my friend, for helping me in my first dynamic programming question. Love from Haryana.
The best explanation i have come across, i have watched other videos of same problem from other instructors , their explanation was also good, but Nikhil the way you've explained is so simple and top notch, thank you very much
Best explanation behind the thought process of approaching the problem. I think we can reduce the space complexity to O(1) because we just need to return the value for the number of ways to reach the nth step. So a sliding window approach can also work, which is kinda similar to dynamic programming, but you don't memoize all values, just the previous 2 values and keep updating it.
by tabulation if you mean storing all results in a table, then yes it is the same. Memoization is just a concept to store your calculated results, you do it in any data structure you like as long as you are saving space/time.
This can be done using 2 ints as well. ```golang func climbStairs(n int) int { if (n == 1 || n == 2) { return n } a, b := 1, 1 for i := 2; i < n; i++ { a, b = b, b + a } return a + b } ```
Nice and clear explanation. Is it possible I have invented something? The numbers you have written in the boxes: 1 2 3 5 8 13 21 34 .. Are the fibonnacci sequence..
Is it bad to use recursive solutions for dynamic programming? I simply used recursion similar to fibonacci and then to make it more performant used a memo obj. That way it will avoid recursion for already encountered inputs. The tabulation approach seems lot less intuitive for more complex problems.
I won't say bad to use recursion but it is definitely less intuitive. When something goes wrong it is very hard to trace what happened, and fixing it becomes problematic. Recursive solutions look small for sure, but it is not necessary that they take less space as well.
Handsdown the best explanation available on youtube for leetcode 70!
I have watched NeetCode, CS Dojo and Kevin Naughton's explanation but couldn't understand the concept behind arr[target] = arr[target-1] + arr[target-2] for this problem until I came across your "How to understand and attack" segment. Thank you for explaining like I'm 5.
I had the same issue. He explained it so much better!
I am just seeing this..I love the explanation...lols....
yes you right
yeah, and i thought neetcode was the best for beginner?
Your approach of explaining is far better than till I have see all videos. Thanks
Man great breakdown. I'm doing interview prep by grinding on leetcode and your videos have been a great way for me to understand how to solve set problems. You do a great job of talking slowly but not too slow and breaking the problem down that is simple to understand.
same here
Your excitement for teaching has no bounds 🙏
thanks for your kind words
you simplified it to a level that my dumb brain can understand. Thank you.
🥲🙌🏻same with my brain
😂 me too.
If this guy makes a math course it’ll be one of the best.
true..and everyone will start coding.
I tried to solve this problem using recursion but TLE.... And you just gave me best solution .... Thank you so much guru🔥💯❤️🙏
really loving this DP playlist! I havent seen any other playlist on DP on youtube that is so easy to understand yet effective. You are an amazing teacher Nikhil! 🙏
Great video! Loved the visuals. You did an excellent job at breaking down the steps needed to approach this problem. Keep it up!
glad you liked it. If you want to see more content like this, consider joining my channel: th-cam.com/channels/T-S2ngqEBoYCM5UKuNeELg.htmljoin
I wish you could have been my teacher for dsa! You are a true teacher, this was so simple to follow I want to cry. Thank you so much sir! Please keep making this type of videos they are life savers for people like me! Thank you thank you! Please could you touch upon recursion and tree problems please !
Thank you so much for your kind words. I do have videos on recursion and tree problems. Check out my playlist on algorithmic paradigms. :)
I hope they are helpful too.
@@nikoo28 why array is of n+1 size, why cant n??
Bcz index starts at 0 if you want to calculate the 8 step you need ans of 8th index but if u pick array of size n you would be providing ans of 7th index instead of 8@@santoshibora1892
@@santoshibora1892 because you need to store all the number of ways for each position of n, that's for memo in that case example dp[0,1,2,3,5,8,13] so if you need to get the max of the steps for n = 13 you go to the dp and return that exactly value.
best explanation...very few people know about this channel , iam sure if you keep on doing such amazing work , iam sure more and more people will get benefitted by your videos
I am trying my best! 🙏
Provides sound explanation of algorithmic approach and solution, indeed worthy channel. Thanks.
i find it much easier to understand these dsa problems when they are reduced to some math equivalent like at 11:49 Thank you so much
Dude, you nailed it. LOVE YOU!
Glad you enjoyed it 😄
Boss you are a king of coding and the best teacher
Thank you so much
I read one of comment which was recently posted, but u replied to that comment also,great !!!
Wowww. Thanks a million bro. After watching many turotials on this, yours is the best! I've understood it! Thanks
I really love your explanations. I am going to watch all that I can
just starting my leetCode journey, with no math background, this video helped me so much, thanks a lot!
I wish you all the very best :)
@@nikoo28 thanks!
The way you explained it made it so easy to understand. Thank you, my friend, for helping me in my first dynamic programming question. Love from Haryana.
You're very welcome!
love your way of teaching sir
Great explanation! This is my first DP, Memoisation Problem!
you are gonna love dynamic programming. Check out House Robber as well. th-cam.com/video/VXqUQYGMnQg/w-d-xo.html
Really excellent explanation, the breakdown of the problem made it much more easier to understand.
Thank you soo much this is my 1st dp question I'm glad i found good description of it thank a lot you are a great tutor
The best explanation i have come across, i have watched other videos of same problem from other instructors , their explanation was also good, but Nikhil the way you've explained is so simple and top notch, thank you very much
really glad you feel that way 😄
simple fibonacci problem your explanation is great
Thank you so much, you helped me understand dynamic programming with such a simple explanation and example.
Brilliant Explanation, Thank You
Thank you so much, first time while I saw the problem, i was like WTH how I am gonna solve this. After seeing your video it's so easy!! ❣
Love it!!! 😁
Excellent sir!, keep going and doing the videos which are very very helpful for us! btw Happy teachers day !
thanks a lot my friend :)
You teach amazing. Thanks for making us understand difficult concepts in a simple way🙂
Glad you feel this way :)
Thank you so much... Best and Easiest explanation ever .
Best explanation behind the thought process of approaching the problem. I think we can reduce the space complexity to O(1) because we just need to return the value for the number of ways to reach the nth step. So a sliding window approach can also work, which is kinda similar to dynamic programming, but you don't memoize all values, just the previous 2 values and keep updating it.
Excellent
This was really helpful!!
Keep up the good work..
I was skeptical but in the end you delivered the understanding
glad i could help you
thank god i got the pseudocode solution for this problem which i was searching finally i got it,thanks
Man great breakdown of this problem, simply the best!
such a lovely solution and explanation
your explanation skill is too good
Amazing explanation ❤
Hey Nikhil, I really liked your way of explanation. keep making such videos. Subscribed.
Thanks for the sub!
you make me fall in love with dynamic programming .please do a live talk with us and give some advices for interview . thanks for the video nikhil.
glad you liked the video. Check out my latest video on Edit Distance too. Just uploaded it today :)
I will have a youtube live coming up soon.
@@nikoo28 glad to know. We like to talk with you.
Awesome explanation !
This is amazing! Thank you
Thanks for your simple explanation.
Wow, Thanks Man It's Very Useful Content Once Again Thank You Pls Be Going....
Really helpfull sir
The way you're explaining is >>>>>>>>>>>>>>>>>>>>>>>>> any other course or youtube channel
It will be so helpful if you tell about my channel to your friends/colleagues as well 😃
@@nikoo28 yes sir shared with community groups
Your Explanation is very good.
Glad you think so!
Very good way to teach brother very depth understanding of the question very good
Excellent explanation!
BTW, the solution of this problem is the Fibonacci sequence.
Yeah
Great explanation.Thank you very much
Omg such an amazing explanation, thank you so much sir 🙏❤️
nice explanation sir. Thank you
awesome explaination bhaiya
Great video
Thank you very much! ❤
Nice explanation 😊
wow I learn now what is dp and memorization thank you sir
Great explaination!!
Yours was the best explanation.
Bahut badhiya padhate ho sir aap 🙏
thank you so so much
the way of explaining was very very good. but we can use simple Fibonacci approach as well.
but how would you know that it is a fibonacci sequence??
hats off to you sir, excellent explanation, and thnks a lot
Lit 🔥very well explained
You too are awesome 😎
I will say just fantastic!
just an amazing explanation
Glad you think so!
Good one, bro. Thank you.
it's Amazing explanation . I loved it.❤❤❤❤❤❤❤❤❤❤❤❤
Adbhoot. Love your explanation
u the best🙌
thank you for the great explanation!
You are simply super nikhil👌🏻, I have few doubts is there any platform where I could connect with you
you can email me
Thank you very much, sir.
observing the output we can also use simple fib program
Awesome Explanation bro
Thank you so much 🙂
Awesome..explanation
😮😮😮😮😮😮😮 you know my reaction
Isnt this is tabulation rather than memoization? As we following bottom up approach from base case to final result 13:37
by tabulation if you mean storing all results in a table, then yes it is the same. Memoization is just a concept to store your calculated results, you do it in any data structure you like as long as you are saving space/time.
Thank you 😇
So, its a modified question of finonacci series problem
not exactly...it just happens to have a fibonacci pattern.
Thank you bhaiya
Awesome explanation
Hi thanks for the video. Can you please explain why dp array size is n+1 and not n?
what a explanation thanks u
Thank you sir!!
love u bhaiya moj kara diii
This can be done using 2 ints as well.
```golang
func climbStairs(n int) int {
if (n == 1 || n == 2) {
return n
}
a, b := 1, 1
for i := 2; i < n; i++ {
a, b = b, b + a
}
return a + b
}
```
Thank you so much!
You're welcome!
Thank you 😊😊
Nice and clear explanation. Is it possible I have invented something? The numbers you have written in the boxes: 1 2 3 5 8 13 21 34 .. Are the fibonnacci sequence..
Great video ❤
Is it bad to use recursive solutions for dynamic programming? I simply used recursion similar to fibonacci and then to make it more performant used a memo obj. That way it will avoid recursion for already encountered inputs. The tabulation approach seems lot less intuitive for more complex problems.
I won't say bad to use recursion but it is definitely less intuitive. When something goes wrong it is very hard to trace what happened, and fixing it becomes problematic. Recursive solutions look small for sure, but it is not necessary that they take less space as well.
Really well explained.
Great explanation
Bro u r really a bro ....
amazing!
Thank you so much sir🎉
very useful
It's like Fibonacci series🎉🎉