public int numSquares(int n) {
while (n % 4 == 0){
n /= 4;
}
if ( n % 8 == 7){
return 4;
}
int a = 0;
while ( (a *a +b*b ==n){
int b = (int) Math.pow
【LeetCode】279. 四平方定理
最新推荐文章于 2022-10-12 17:46:30 发布
public int numSquares(int n) {
while (n % 4 == 0){
n /= 4;
}
if ( n % 8 == 7){
return 4;
}
int a = 0;
while ( (a *a +b*b ==n){
int b = (int) Math.pow