Dynamic Programming
Solve each subproblem once, write it down, and hard problems collapse into loops.
5 lessons · ~52 min · free
By the end you can
- Spot the repeated work that makes naive recursion explode
- Turn a recursive solution into a memoized one mechanically
- Build bottom-up tables and shrink them to constant space
- Derive recurrences by asking what the last decision was
- Tell DP from greedy and backtracking before writing any code
Lessons
Start the course- The same problem, solved again9 minNaive Fibonacci's call tree, counted: where the exponential blowup lives and what a cache does to it.
- From recursion to a loop11 minClimbing stairs four ways: plain recursion, memo, bottom-up table, two variables.
- Take it or skip it11 minHouse robber: deriving a recurrence from the last decision, then filling the table.
- Minimums and unlimited choices12 minCoin change: min instead of count, reusable choices, and infinity as "not reachable yet".
- Spotting DP problems9 minCount-ways and min-cost cues, DP vs greedy vs backtracking, and the 1-D checklist.
The account is free and so is every lesson. It unlocks the courses and saves your progress.
Practice it after
The final lesson links here too: real interview questions that test this pattern, in an editor with execution and AI feedback.