We use cookies for site analytics. Accept to help us understand how the site is used. See our Privacy Policy for details.
DP is recursion plus memory: define the state, write the recurrence, then decide whether to memoize top-down or fill a table bottom-up. The difficulty is almost never the code - it is naming the state precisely enough that the recurrence writes itself. Work the 1D problems (climbing stairs, house robber, coin change) until the state definition is reflexive, then the 2D grid and string problems become variations rather than new material.
"Number of ways", "minimum/maximum cost", or a recursion that recomputes the same state.
49 problems. Each one runs in an in-browser editor against real test cases, with hints and a worked solution.
The patterns cheat sheet covers all of these in one page - what each one looks like in a problem statement, and the template that follows.