Skip to content

Instantly share code, notes, and snippets.

@erikseulean
Created June 12, 2022 15:06
Show Gist options
  • Save erikseulean/80c597ce77a7c262e523142af408e821 to your computer and use it in GitHub Desktop.
Save erikseulean/80c597ce77a7c262e523142af408e821 to your computer and use it in GitHub Desktop.
def find_perfect_squares(number):
perfect_squares = {i * i for i in range(sqrt(n)}
for other_i in sqrt(n):
if n - other_i * other_i in perfect_squares:
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment