Problem in DP problems

Can someone suggest how to solve DP problems. Whenever i try to solve DP problems I somehow get stuck and can’t even figure out what could be the possible approach. As an example I was trying this problem

I was not able to solve. It is getting frustrating for me now. Every time i loose myself and tempted to look at the editorial. Can anyone please help me out what i could do. Because, i really want to improve on this area. But i always get stuck.

According to me, essence of dynamic programming is in finding the correct recursive relation which requires solving lot of problems. I can’t explain everything right now but I have written many blogs and made some videos on dynamic programming. You can check them out.

  1. Dynamic Programming Written Tutorials
  2. Dynamic Programming Video Tutorials
1 Like