We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6305d59 commit 4a82ebcCopy full SHA for 4a82ebc
project_euler/problem_009/sol4.py
@@ -45,8 +45,8 @@ def solution(n: int = 1000) -> int:
45
46
squares = get_squares(n)
47
squares_set = set(squares)
48
- for a in range(1, n // 3):
49
- for b in range(a + 1, (n - a) // 2):
+ for a in range(1, n // 3 + 1):
+ for b in range(a + 1, (n - a) // 2 + 1):
50
if (
51
squares[a] + squares[b] in squares_set
52
and squares[n - a - b] == squares[a] + squares[b]
0 commit comments