1class Solution {2 public boolean judgeSquareSum(int c) {3 long a = 0;4 long b = (long) Math.sqrt(c);56 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}
WPM •0 •0
ACC •0 •0
TIME •0