
Desicription
Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n.
Example 1:
1 |
Input: n = 12 |
Example 2:
1 |
Input: n = 13 |
Solution
1 |
class { |

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n.
Example 1:
1 |
Input: n = 12 |
Example 2:
1 |
Input: n = 13 |
1 |
class { |
近期评论