AAlgoLoopSpaced repetition for LeetCode

Dynamic Programming

Dynamic programming solves a problem by combining answers to overlapping subproblems, each computed once and stored. Reach for it when a problem asks for an optimum (max, min, or count) and the choice at each step depends on the results of smaller versions of the same problem.

55 LeetCode problems solved with the Dynamic Programming pattern. Practice them with spaced repetition so the pattern sticks.

See the full solution

The complete approach, reference solutions in 5 languages, and a step-by-step visualization — then add this problem to your spaced-repetition schedule.

Start free →