给定正整数 n,找到若干个完全平方数(比如 1, 4, 9, 16, ...) 使得他们的和等于 n.你需要让平方数的个数最少.比如 n = 12,返回 3 ,因为 12 = 4 + 4 + 4 : 给定 n = 13,返回 2 ,因为 13 = 4 + 9. 详见:https://leetcode.com/problems/perfect-squares/description/ Java实现: 方法一:递归实现 class Solution { public int numSquares(i…