1
class Solution {
2
public boolean judgeSquareSum(int c) {
3
long a = 0;
4
long b = (long) Math.sqrt(c);
5

6
while (a <= b) {
7
if (((a * a) + (b * b)) == c) {
8
return true;
9
} else if ((((a * a) + (b * b)) < c)) {
10
a++;
11
} else {
12
b--;
13
}
14
}
15
return false;
16
}
17
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0