Dynamic Programming Python lessons
State design, recurrences, memoization, tabulation, optimization, and overlapping subproblems.
Core concepts
Problem-solving patterns
- dynamic programming · Fibonacci
- house robber · DP
- coin change · bottom-up DP
- knapsack · space optimization
- LIS · binary search
What this topic builds
Learn the idea once, trace it through two verified cases, then explain why your approach works.
All 11 lessons in this topic
Work from top to bottom to build each concept gradually.
- #164Count ways to climb stairsBeginnerPremium
Count different one-step and two-step sequences that reach stair five.
- #165Maximize nonadjacent house lootIntermediatePremium
Find the maximum value without choosing adjacent houses.
- #166Find minimum coinsIntermediatePremium
Find the fewest coins needed to make eleven.
- #167Solve 0/1 knapsackIntermediatePremium
Maximize value under a small carrying capacity.
- #168Find longest increasing subsequence lengthAdvancedPremium
Find the LIS length in a common interview example.
- #169Find longest common subsequence lengthAdvancedPremium
Find the LCS length for two strings with characters in common order.
- #170Calculate edit distanceAdvancedPremium
Find the minimum edits needed to convert kitten to sitting.
- #171Partition values into equal sumsInterview-LevelPremium
Determine that the values can be split into two equal-sum groups.
- #172Segment a string into dictionary wordsInterview-LevelPremium
Check whether the complete string can be split into dictionary entries.
- #173Count numeric message decodingsInterview-LevelPremium
Count all A-to-Z interpretations of a digit string.
- #174Count unique paths with obstaclesInterview-LevelPremium
Count right-and-down routes that avoid a blocked cell.