LC633 - Sum of Square Numbers
Problem
Example
Solution
Basic
def judgeSquareSum(self, c: int) -> bool:
# iterate from a
for a in range(int(math.sqrt(c))+1):
b = math.sqer(c - pow(a,2))
if b % 1 == 0:
return True
return FalseFaster
Last updated