Dynamic Programming
Break a problem into overlapping subproblems and reuse their answers to avoid recomputing the same work.
Dynamic Programming Practice Problems
Easy
3 problemsMedium
9 problems- 48medium
House Robber
Find the most money you can rob from a row of houses without robbing two next to each other.
- 49medium
Coin Change
Find the fewest coins needed to make up a given amount from a set of coin values.
- 50medium
Longest Increasing Subsequence
Find the length of the longest subsequence of an array that is strictly increasing.
- 51medium
Unique Paths
Count how many distinct paths lead from the top-left to the bottom-right of a grid.
- 52medium
Longest Common Subsequence
Find the length of the longest sequence that appears in the same order in two strings.
- 53medium
Word Break
Check whether a string can be split into a sequence of words from a given dictionary.
- 54medium
Partition Equal Subset Sum
Check whether an array can be split into two groups with equal sums.
- 55medium
Decode Ways
Count how many ways a string of digits can be decoded into letters.
- 56medium
Combination Sum IV
Count how many ordered combinations of numbers add up to a target value.
Hard
4 problems- 57hard
Edit Distance
Find the fewest single-character edits needed to turn one word into another.
- 58hard
Regular Expression Matching
Check whether a string fully matches a pattern that supports "." and "*".
- 59hard
Burst Balloons
Find the maximum coins you can collect by bursting balloons in the best order.
- 60hard
Longest Valid Parentheses
Find the length of the longest substring of well-formed parentheses.
Related concepts
| Topic | Description |
|---|---|
| Greedy Algorithms | Make the locally best choice at each step and never look back, useful when local optima add up to a global optimum. |
| Sliding Window | Solve fixed-window problems: maximum sum of k elements, moving averages, and O(n) updates as the window slides. |
| Two Pointers | Scan a sorted array or string from both ends at once to find pairs, remove duplicates, or reverse data in O(n). |
| Binary Search | Cut a sorted range in half on every step to find a value or boundary in O(log n) instead of checking one by one. |
| Depth-First Search | Explore as far as possible down one path before backtracking, used to walk trees, graphs, and grids. |
| Breadth-First Search | Explore level by level from a starting point, the go-to way to find the shortest path in an unweighted graph. |