Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions perfect_square_sum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```python
def is_perfect_square(n: int) -> bool:
"""
Check if a number is a perfect square.

:param n: The number to check.
:return: True if the number is a perfect square, False otherwise.
"""
if n < 0:
return False
root = int(n ** 0.5)
return root * root == n


def perfect_square_sum(numbers: set[int]) -> int: