Regarding Dynamic Programming

I am not able to understand how to build a recurrence relation and how to define state in a given problem.

It all comes with practice. Even if you think, there’s no trick involved in this. Start with the very basic and standard problems and move on slowly. As you’ll progress, you’ll start observing a pattern in them and will realise that you’re doing the same thing everytime one way or another. So all you need is a bit of a practice.:blush:

How to decide what will be the size of the DP array ,like 1D or 2D ?

Can you provide such a curated list of standard problems! Will doing cf problems in increasing order of difficulty will do good?

That’s easy, just lookup the number of variants in the approach you’ve decided.

Yeah, doing CF will be great. Here’s the list you’re looking for.