Hello people. I have a hard time visualizing the backtracking tree and providing the Dynamic Programming optimization for it. Can anyone help me to get better at this and also to get better at solving DP problems.... 🙂
most people won't watch and also most companies wouldn't even expect you to come up with tabulation(space optimized) method during an interview, only small % of people would probably be capable of doing that on the spot and they usually go through other resources to learn that niche stuff
hey neetcode , i think we can rid off next_dp array if we build the solution up-bottom mod=10**9+7 dp=[0]*target+[1] for i in range(n-1,-1,-1): for s in range(target+1): dp[s]=0 for j in range(1,k+1): if s+j>target:break dp[s]=(dp[s]+dp[s+j])%mod return dp[0]
The thumbnails of your previous videos were better with Company logos.. please continue putting company logos in the thumbnail as it is easy to pick company specific questions xD
Is that a medium complexity problem for real? You need to be a real smart ass to figure that out. As for me, it's not about programming in general - it's more about having uni education to be able to build such math yourself. I'm also curious how much time did it take for you to solve this problem?
Another problem down the drain for me. I barely understood your solution (not your fault). I need to study DP and backtracking. You would think a degree would prepare you for that.
I was completely lost with DP until I watched videos such as Tech with Nikola and his Mastering Dynamic Programming videos. In addition, I would suggest doing easier DP problems as well such as House Robber. While I couldn’t come up with a solution for this problem, I can at least understand the solutions! Good luck, let’s all work for a better future
A small improvement for the first solution (memoization) is to include a base case that stops recursion if the target becomes negative.
I'm done for today. New year resolution would be to learn dynamic programming 😅
Merry Christmas Neetcode !
Giving 5 easies in row just to hit u with DP problem on Christmas day 😂😂 Someone had a bad day
Well, problems through the entire December until 25th were really easy (even those marked as medium), and then they hit us with 2 DP in a row 😅
Hello people. I have a hard time visualizing the backtracking tree and providing the Dynamic Programming optimization for it. Can anyone help me to get better at this and also to get better at solving DP problems....
🙂
try cses dp section
@@caiodavi9829 cses?
merry Christmas!
wonderful solution but if you go memoization ->tabulation ->tabulation(space optimized) it
would be helpful for beginners to learn all 3 variations
Thf he's done a bunch of problems almost identical to this where he's done it in that order. There's no need to go through it again every time.
@@two697 you may be skilled enough and you may dnt need it
I am talking from a beginner perspective
The main reason I don't always do this is because it results in a very long video, which most people won't watch.
most people won't watch and also most companies wouldn't even expect you to come up with tabulation(space optimized) method during an interview, only small % of people would probably be capable of doing that on the spot and they usually go through other resources to learn that niche stuff
@@NeetCodeIO true i would say
Merry Christmas!
hey neetcode , i think we can rid off next_dp array if we build the solution up-bottom
mod=10**9+7
dp=[0]*target+[1]
for i in range(n-1,-1,-1):
for s in range(target+1):
dp[s]=0
for j in range(1,k+1):
if s+j>target:break
dp[s]=(dp[s]+dp[s+j])%mod
return dp[0]
The thumbnails of your previous videos were better with Company logos.. please continue putting company logos in the thumbnail as it is easy to pick company specific questions xD
I got the memoization solution myself but the bottom up tabulation solutions are tricky :/
i wish i was as good as you 😭
Is that a medium complexity problem for real? You need to be a real smart ass to figure that out.
As for me, it's not about programming in general - it's more about having uni education to be able to build such math yourself.
I'm also curious how much time did it take for you to solve this problem?
Why we take mod as 10**9 + 7?
because its a prime number
why don't you publish the solution on leetcode ?
Why do we need the mod
To not overflow the number we are tracking.
Another problem down the drain for me. I barely understood your solution (not your fault). I need to study DP and backtracking. You would think a degree would prepare you for that.
same boat, don't stress too much we got this
I was completely lost with DP until I watched videos such as Tech with Nikola and his Mastering Dynamic Programming videos. In addition, I would suggest doing easier DP problems as well such as House Robber. While I couldn’t come up with a solution for this problem, I can at least understand the solutions! Good luck, let’s all work for a better future
thank you sir@@coolkaw4497
I think I am too young for this concept 😅🤣
Never too young to learn programming ! Be ahead of the game !
merry Christmas!
Merry Christmas!