Basic Problemsminimizationlinear

Minimum Perfect Squares

Given a positive integer n, find the minimum number of perfect squares, such as 1, 4, 9, or 16, that add up to exactly n.

Do this lesson first: coin change

The full breakdown and animated table for this problem are still being written. In the meantime, run the four questions on it yourself — that is the whole exercise.