Topics / Dynamic Programming
🧩
Dynamic Programming
Overlapping subproblems + optimal substructure — memoization and tabulation, demystified.
Why learn Dynamic Programming?
-
The interview topic that scares people the most — and rewards practice the most.
-
Many "hard" problems reduce to a 1D or 2D DP table.
-
Builds your skill to recognize state and transitions in any algorithm.
What you can build with Dynamic Programming
Sequence problems (LIS, LCS, edit distance) Knapsack and partition problems Counting paths and partitions on grids
Dynamic Programming tutorials
6 articlesHand-written tutorials, ordered as a recommended learning path.
- 01 DP — Intro An introduction to dynamic programming — overlapping subproblems, optimal substructure, top-down memoization, and bottom-up tabulation, with worked examples in Python.
- 02 DP — Practice Eight classic dynamic programming problems — Climbing Stairs, House Robber, Coin Change, LIS, Word Break, 0/1 Knapsack, Edit Distance, and LCS — each with Python solutions and DP tables.
- 03 Climbing Stairs Walk through LeetCode 70 Climbing Stairs from brute force recursion to bottom-up DP, with edge cases, complexity analysis, and an interview script.
- 04 Coin Change Walk through LeetCode 322 Coin Change with brute force recursion, memoization, and bottom-up DP. Includes complexity analysis and interview script.
- 05 House Robber Solve LeetCode 198 House Robber with the pick-or-skip DP recurrence, then optimize to O(1) space. Includes interview script and related variants.
- 06 Word Break Solve LeetCode 139 Word Break with bottom-up dynamic programming. Includes brute force, edge cases, complexity analysis, and an interview script.