DP = recursion + memoization. So you're showing recursion (divide-and-conquer) for various data structures. Memoization avoids duplicate work on shared subproblems. Good job.
Thanks for this! I am trying to understand this by converting the code to python and kinda stuck... At 13:37, you used vectordp(n+1). What does that mean for the initial values of dp? I can't create a blank array of size n using python afaik. So, what should be the initial values of the dp array? Also, imho, people who are using C++ for programming interviews will not be watching these types of videos lol
Here's the list: algo.monster/dp
Best DP intuition building video.
DP = recursion + memoization. So you're showing recursion (divide-and-conquer) for various data structures. Memoization avoids duplicate work on shared subproblems. Good job.
Thank you🙏
Thanks for viewing! Glad it helps.
Needed this thank you!!
Tiny Code:
class Solution {
public int climbStairs(int n) {
int one = 1, two = 1;
for (int i = 2; i
nice vid thanks
The code you wrote for the problem "1043. Partition Array for Maximum Sum" isn't giving the right output.
Thanks for this!
I am trying to understand this by converting the code to python and kinda stuck...
At 13:37, you used vectordp(n+1). What does that mean for the initial values of dp?
I can't create a blank array of size n using python afaik. So, what should be the initial values of the dp array?
Also, imho, people who are using C++ for programming interviews will not be watching these types of videos lol
Ok, initialized with 0s and it worked.
vectordp(n+1) initializes all elements to 0. oh haha, noted, will try to use python in the future!
Awesome video ..✨
Thank you 🤗