Dynamic Programming

Break a problem into overlapping subproblems and reuse their answers to avoid recomputing the same work.

Dynamic Programming Practice Problems

Easy

3 problems
  1. 45

    Climbing Stairs

    Count how many distinct ways you can climb a staircase taking one or two steps at a time.

    easy
  2. 46

    Fibonacci Number

    Compute the nth number in the Fibonacci sequence.

    easy
  3. 47

    Min Cost Climbing Stairs

    Find the cheapest way to reach the top of a staircase where every step has a cost.

    easy

Medium

9 problems
  1. 48

    House Robber

    Find the most money you can rob from a row of houses without robbing two next to each other.

    medium
  2. 49

    Coin Change

    Find the fewest coins needed to make up a given amount from a set of coin values.

    medium
  3. 50

    Longest Increasing Subsequence

    Find the length of the longest subsequence of an array that is strictly increasing.

    medium
  4. 51

    Unique Paths

    Count how many distinct paths lead from the top-left to the bottom-right of a grid.

    medium
  5. 52

    Longest Common Subsequence

    Find the length of the longest sequence that appears in the same order in two strings.

    medium
  6. 53

    Word Break

    Check whether a string can be split into a sequence of words from a given dictionary.

    medium
  7. 54

    Partition Equal Subset Sum

    Check whether an array can be split into two groups with equal sums.

    medium
  8. 55

    Decode Ways

    Count how many ways a string of digits can be decoded into letters.

    medium
  9. 56

    Combination Sum IV

    Count how many ordered combinations of numbers add up to a target value.

    medium

Hard

4 problems
  1. 57

    Edit Distance

    Find the fewest single-character edits needed to turn one word into another.

    hard
  2. 58

    Regular Expression Matching

    Check whether a string fully matches a pattern that supports "." and "*".

    hard
  3. 59

    Burst Balloons

    Find the maximum coins you can collect by bursting balloons in the best order.

    hard
  4. 60

    Longest Valid Parentheses

    Find the length of the longest substring of well-formed parentheses.

    hard