Skip to content

1-D Dynamic Programming

Dynamic programming is "don't solve the same question twice". Break a problem into smaller versions of itself, solve each small version once and write down the answer. In 1-D problems the state is a single index: "the best answer for the first i items".

After this topic: You can define dp[i] in words, write the transition, find the base case and then compress the space.

Do these first: Backtracking

0 of 12 solved0%

Step 1 · Read the lesson

Dynamic Programming

Break a problem into overlapping subproblems and solve each only once.

Step 2 · Solve the problems in order

Try each one for about 20 minutes first. Problems with a Run code tab are checked right here. If you are stuck, open Nudge, think again, then Idea. Go skeleton only gives the function shape, and Reference solution is for comparing after you have tried. Tick the box when you could solve it again without help.

  1. 1.Climbing StairsEasy
  2. 2.Min Cost Climbing StairsEasy
  3. 3.House RobberMedium
  4. 4.House Robber IIMedium
  5. 5.Longest Palindromic SubstringMedium
  6. 6.Palindromic SubstringsMedium
  7. 7.Decode WaysMedium
  8. 8.Coin ChangeMedium
  9. 9.Maximum Product SubarrayMedium
  10. 10.Word BreakMedium
  11. 11.Longest Increasing SubsequenceMedium
  12. 12.Partition Equal Subset SumMedium

Step 3 · What this unlocks