# Hello there, I am having hard time dealing with dp problems can you help me get started with them

**URL:** <https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110>\
**Category:** general\
**Tags:** dynamic-programming\
**Created:** [June 8, 2020, 12:40pm UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110 "2020-06-08T12:40:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon58713095](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@anon58713095](https://discuss.codechef.com/u/anon58713095)\
**Post date:** [June 8, 2020, 12:40pm UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/1 "2020-06-08T12:40:58Z")

</div>

To put you into perspective I am not able to even recognize the problem type, I am somewhat confident in graph theory and number theory problems but dynamic programming just seems too difficult, any suggestions of where I could get started with it also the main problem I’m facing with it is I’m unable to understand why dp is even needed( of course I am at fault and part of the reason is why I’m asking you this ) and just could not anticipate it’s use case.

---

<div class="post-metadata">

**Author:** ![harsh\_joeyit](https://discuss.codechef.com/user_avatar/discuss.codechef.com/harsh_joeyit/32/20425_2.png) [@harsh\_joeyit](https://discuss.codechef.com/u/harsh_joeyit)\
**Post date:** [June 17, 2020, 11:24am UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/2 "2020-06-17T11:24:56Z")

</div>

Hey there @anon58713095. I am learning DP too.  
I would suggest you to try these out too.

1.[Tushar Roy DP tutorial](https://www.youtube.com/playlist?list=PLrmLmBdmIlpsHaNTPP_jHHDx_os9ItYXr)  
2. [Rachit Jain’s Dp tutorial(could be bit overwhelming)](https://www.youtube.com/watch?v=tb_14w_-mNw&list=PLfBJlB6T2eOtMXgK3FLUTawHjzpIEySHF)  
3. [At coder Educational DP Contest](https://atcoder.jp/contests/dp)  
4. [This great blog post](https://codeforces.com/blog/entry/67679)  
5. [Codeforces problem set(try them out in ascending order of diffficulty)](https://codeforces.com/problemset/page/2?tags=dp&order=BY_RATING_ASC)

Hope it helps.  
Cheers.

---

<div class="post-metadata">

**Author:** ![hitch\_hiker42](https://discuss.codechef.com/user_avatar/discuss.codechef.com/hitch_hiker42/32/214518_2.png) [@hitch\_hiker42](https://discuss.codechef.com/u/hitch_hiker42)\
**Post date:** [June 17, 2020, 12:14pm UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/3 "2020-06-17T12:14:32Z")

</div>

The best thing to get you **started** is the chapter on CLRS in my opinion. After that, binge-solve as many classical problems (and their variations) as you can. Proceed to other tutorials on the way: the wine problem answer on Quora, TopCoder, Algorithms Live, Codeforces blogs on the topic, to name a few. Give a week or two to the topic in this fashion and you’ll feel start feeling comfortable with the problems. Also, most guys will suggest the AtCoder DP contest which is great by the way (but you need more than just a week or two practice to finish that exhaustively). I hope you start seeing the patterns with enough practice. One more thing: **don’t ask anymore and start practicing!**

---

<div class="post-metadata">

**Author:** ![nik\_united](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@nik\_united](https://discuss.codechef.com/u/nik_united)\
**Post date:** [June 17, 2020, 1:26pm UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/4 "2020-06-17T13:26:26Z")

</div>

I also struggled (and still struggle) with DP. But what helped me understand it better was - “look at DP problems as recursion problems i.e. Make recursive solution first and then the actual DP part is just optimizing it by storing the repeated work”. This is the top-down approach and this helped me the most.  
Once you get this by lots of practice, the bottom-up(tabulation) will come naturally to you.

Now, if you are week at recursion you will be week at DP. Thus try recursive problems first, if you are week at them. A great resource for recursion -

1. [ByteByByte Recursion](https://www.byte-by-byte.com/recursion/)

If you feel confident about making recursive solutions, then some great resources for top-down DP are -

1. [Aditya Verma DP tutorial](https://www.youtube.com/playlist?list=PL_z_8CaSLPWekqhdCPmFohncHwz8TY2Go)
2. [Back to Back SWE DP solution videos](https://www.youtube.com/playlist?list=PLiQ766zSC5jM2OKVr8sooOuGgZkvnOCTI)
3. [Doc 1](https://simpleprogrammer.com/guide-dynamic-programming/)
4. [Doc 2](https://medium.com/cs-dojo/an-introduction-to-dynamic-programming-89fdd3549d54)
5. [Doc 3](https://www.freecodecamp.org/news/follow-these-steps-to-solve-any-dynamic-programming-interview-problem-cc98e508cd0e/)
6. [Doc 4](https://www.freecodecamp.org/news/demystifying-dynamic-programming-3efafb8d4296/)

---

<div class="post-metadata">

**Author:** ![hello\_hell](https://discuss.codechef.com/user_avatar/discuss.codechef.com/hello_hell/32/53660_2.png) [@hello\_hell](https://discuss.codechef.com/u/hello_hell)\
**Post date:** [June 17, 2020, 2:50pm UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/5 "2020-06-17T14:50:35Z")

</div>

Problem Set: [CSES - CSES Problem Set - Tasks](https://cses.fi/problemset/list)  
Solution for DP problems: [CSES DP section editorial - Codeforces](https://codeforces.com/blog/entry/70018)

After this, you could approach hacker-rank dp problems. Just because those problems are solved by many people so it will be easy to find tutorials online.

---

<div class="post-metadata">

**Author:** ![vai53](https://discuss.codechef.com/user_avatar/discuss.codechef.com/vai53/32/8794_2.png) [@vai53](https://discuss.codechef.com/u/vai53)\
**Post date:** [June 17, 2020, 2:58pm UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/6 "2020-06-17T14:58:59Z")

</div>

Aditya Verma is okay, he keeps repeating, half of his video has no value. it feels like he is spoon feeding. i got vexed even though i watched it in 2x

---

<div class="post-metadata">

**Author:** ![csk111165](https://discuss.codechef.com/user_avatar/discuss.codechef.com/csk111165/32/53994_2.png) [@csk111165](https://discuss.codechef.com/u/csk111165)\
**Post date:** [June 17, 2020, 5:57pm UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/7 "2020-06-17T17:57:00Z")

</div>

I guess for beginner it is good .

---

<div class="post-metadata">

**Author:** ![the\_redbaron](https://discuss.codechef.com/user_avatar/discuss.codechef.com/the_redbaron/32/18600_2.png) [@the\_redbaron](https://discuss.codechef.com/u/the_redbaron)\
**Post date:** [June 17, 2020, 6:31pm UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/8 "2020-06-17T18:31:46Z")

</div>

Take a look here @anon58713095 [Data Structures and Algorithms](https://discuss.codechef.com/t/data-structures-and-algorithms/6599)

---

<div class="post-metadata">

**Author:** ![nik\_united](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@nik\_united](https://discuss.codechef.com/u/nik_united)\
**Post date:** [June 20, 2020, 3:25pm UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/9 "2020-06-20T15:25:22Z")

</div>

yaa you are right. The videos were too long but as a beginner I found them helpful that’s why I suggested them.

---

<div class="post-metadata">

**Author:** ![ameybhavsar](https://discuss.codechef.com/user_avatar/discuss.codechef.com/ameybhavsar/32/26566_2.png) [@ameybhavsar](https://discuss.codechef.com/u/ameybhavsar)\
**Post date:** [June 20, 2020, 5:59pm UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/10 "2020-06-20T17:59:45Z")

</div>

Can you share links to more Atcoder educational contests?

---

<div class="post-metadata">

**Author:** ![harsh\_joeyit](https://discuss.codechef.com/user_avatar/discuss.codechef.com/harsh_joeyit/32/20425_2.png) [@harsh\_joeyit](https://discuss.codechef.com/u/harsh_joeyit)\
**Post date:** [June 21, 2020, 4:56am UTC](https://discuss.codechef.com/t/hello-there-i-am-having-hard-time-dealing-with-dp-problems-can-you-help-me-get-started-with-them/68110/11 "2020-06-21T04:56:19Z")

</div>

I do not practice at Atcoder, but I think the Educational DP contest is the most famous out there.  
This was especially made for DP, there might not be for other topics if you are looking for them.
