Perfect Squares
Explore how to solve problems that require finding the smallest number of perfect square numbers that sum to a given integer. Understand the concept of perfect squares, and develop an efficient approach to implement the solution within coding interviews.
We'll cover the following...
We'll cover the following...
Statement
Given an integer, n, return the least number of perfect square numbers that sum to n.
A perfect square is an integer that is the square of an integer. In other words, it is an integer that is the result of multiplying a whole integer by itself. For example,
, ...