Skip to content
BytePatterns

Dynamic Programming

Solve every subproblem once, then let the table do the work.

Dynamic Programming progress0 / 10
  1. What Is Dynamic Programming?Solve each overlapping subproblem once, then reuse the answer.5m
  2. Top-Down vs Bottom-UpOne recurrence, two directions: recurse and cache, or fill a table.5m
  3. Climbing StairsWays to reach step n = ways to n-1 plus ways to n-2.4m
  4. House RobberTake this one and skip its neighbour, or skip it and keep the best.5m
  5. Coin ChangeFewest pieces to hit a target, one amount at a time.6m
  6. Longest Common SubsequenceMatch the two ends, or drop a character from one side.6m
  7. 0/1 KnapsackEach item is all or nothing, so try both and keep the better.6m
  8. Edit DistanceInsert, delete, or replace — count the cheapest route.6m
  9. Longest Increasing SubsequenceEvery element asks which smaller one it can extend.6m
  10. DP on GridsEach cell's answer comes from the cells above and to its left.6m