Dynamic Programming Cheat Sheet
You save the result of each recursive call so you only solve each smaller problem once.

Unlock the full sheet below.
When to use it
- The problem breaks into smaller versions of itself that repeat.
- Plain recursion would solve the same smaller problem many times.
- It asks you to count the ways to do something, or find a min or max over a series of choices.
What's on the sheet
The sheet has a code template you can reuse for every Dynamic Programming problem. It's split into four steps so you can see which part changes from problem to problem. It also shows how to spot the pattern, how fast it runs, the mistakes people often make and the variations you'll see in interviews.
How to get it
You can unlock it with a free account by solving 2 of this pattern's problems.
Preview the Two Pointers sample to see a finished sheet first.