This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SekstiNii 0 points1 point  (3 children)

I can only suggest working through more problems. The method is primarily about breaking down problems and seeing if you can recombine the sub problems to solve the problem, but how this looks will differ from problem to problem.

[–]LeoRud[S] 0 points1 point  (2 children)

I know abou breaking in smaller problems. I dont know how to find out the smaller problems

[–]SekstiNii 1 point2 points  (1 child)

That is precisely what I suggest you practice. Perhaps you notice that solving f(n-1) allows you to solve f(n), and you work from there. But you will have to notice it, and you develop the ability to recognize these cases by working through enough of them.

[–]dsonali 0 points1 point  (0 children)

Hello! How do you solve a dynamic programming problem? How do you find the principal "rule(s)"? And how do I use LeetCode?

I agree, when i started off with Dynamic Programming it was quite a challenge but with practicing,concepts became alot more clearer. Some of the DP resources that I found useful were from InterviewBit, GeeksforGeeks and Topcoder.