0%
1 2 3 4 5 6 7 8 9 10 11 12 13
| class Solution: def judgeSquareSum(self, c: int) -> bool: left = 0 right = int(sqrt(c)) while left<=right: if left*left + right*right == c: return True elif left*left + right*right > c: right -= 1 else: left += 1 return False
|