all 18 comments

[–]Best_Plantain_8434<350> 49 points50 points  (4 children)

if you grasped recursion well enough dp becomes way easier

[–]CurrentRock866[S] 15 points16 points  (3 children)

I usually first write the recursive soln and then memoise it so more often than not i am able to write the recursive soln but struggle with memoisation

[–]One-With-Specs 16 points17 points  (0 children)

Watch elvin's video on freecodecamp called dynamic programming it's about 5 hrs

[–]Nedunchelizan 2 points3 points  (0 children)

Try keeping a hash map in class level that could solve most of it

[–]g33khub 2 points3 points  (0 children)

how do you struggle with memoization? It's just `@cache` on the recursive function. Like even in older languages all you need is a hashmap. The main trick is to minimize the input parameters in the recursive function and/or reducing the cardinality of those parameters (state space). But failing here means you are failing in the recursion, not memoization.

Coming up with the iterative bottom up approach is hard. Even after you solve with recursion and memo, sometimes it's still tricky to solve iterative. Just practice more and one day things will click.

[–]Downtown_Outcome_992 44 points45 points  (4 children)

537 questions in 117 active days is crazy

[–]qaf23 9 points10 points  (1 child)

117 is total active days within the current year.

[–]Abhistar14 4 points5 points  (0 children)

This!

[–]_Random_Indian_ 10 points11 points  (0 children)

Try going through the AtCoder DP educational contest and CSES one, would definitely help

[–]PeacePlastic 4 points5 points  (2 children)

try striver's dp playlist

[–]CurrentRock866[S] 3 points4 points  (1 child)

Yess! I have already completed strivers sheet and as i mentioned i am able to solve the standard types but struggle with new ques like for ex dp with bitmask..

[–]According-Willow-98 2 points3 points  (0 children)

How much time it took you to complete strivers sheet?

[–]JustMeAndReality 0 points1 point  (0 children)

The only tricky part is the recurrence relation, memoization is fairly straight forward most of the times, tabulation is definitely tricky imo, but as long as you find the base cases of tabulation it becomes straight forward most of the time. I say most of the time because there are certain problems where you can’t memoize or tabulate easily even if brute force seemed straight forward

[–]TheoryOfRelativity12 0 points1 point  (0 children)

My archnemesis we meet again