Pattern 18b: Dynamic programming — 2D and knapsack
Comes up in: DSA
This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.
What it covers
- grid DP
- two-string DP (LCS, edit distance)
- 0/1 knapsack and subset sum
- reconstructing the answer
Words you will know
What you will practise
- unique-paths (M)
- longest-common-subsequence (M)
- partition-equal-subset-sum (M)
- edit-distance (H)