Advertisement
Guest User

Square Sum

a guest
Mar 1st, 2021
99
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def judgeSquareSum(c: int) -> bool:
  2.     maxA = sqrt(c)
  3.  
  4.     for a in range(int(maxA) + 1):
  5.         if sqrt(c - a**2).is_integer():
  6.             return True
  7.  
  8.     return False
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement