Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
1 like 0 dislike
1,908 views
How to become good at dp and graphs problems , what is the smart strategy that generally good coders follow , I am finding it hard to understand and even in implementation part too . I know it requires hell lot of practise but still I want to know , How good coders plan to do any hard topics and which study materials they follow .
in Competitive-Programming by
recategorized by | 1,908 views

1 Answer

0 like 0 dislike
Best answer

I am Master rated on codeforces. 

My advice for dynamic-programming : 

1) Always , try to think iteratively , find the answer for , say n=1,n=2,n=3,..... Now, slowly, but surely you will see a relation between these values . 

2)Write that relation/formula on paper . Create few for loop(s) , to calculate value for dp[1],dp[2],dp[3].....and finally dp[n] should be the final answer for the question . 

3)Enjoy and love the process of mastering dynamic-programming . 

4)Think very deeply on dp-related problems before looking at a solution. This way your brain gets better and retains the most . 

5) There are some standard dp-tricks(like 40-50 special tricks) . Memorize all those paradigms and tricks by heart like , for example : - a)Coin-change-problem , b)LCS , c)LIS , d)Edit-Distance , etc . 

6)Solve many problems which are variations of standard problems . Memorize and understand all the required tricks. 

7)Dp-Problems which you see in programming contests are nothing but variation of standard-dp-problems.

8)Practice and learn from : 

i)https://codeforces.com/problemset?tags=dp,1500-2000 

ii)https://www.topcoder.com/tc?module=ProblemArchive&sr=&er=&sc=&sd=&class=&cat=Dynamic+Programming&div1l=&div2l=3&mind1s=&mind2s=&maxd1s=&maxd2s=&wr= 

iii)https://atcoder.jp/contests/dp

iv)Best dp-tutorials : https://www.desiqna.in/44/best-tutorials-of-dynamic-programming-for-free 

Hope it helps!

by Expert (115,900 points)
selected by
0 0
Thanks for giving me proper guidance :)