Skip to content

Commit 4a82ebc

Browse files
Update sol4.py
1 parent 6305d59 commit 4a82ebc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

project_euler/problem_009/sol4.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def solution(n: int = 1000) -> int:
4545

4646
squares = get_squares(n)
4747
squares_set = set(squares)
48-
for a in range(1, n // 3):
49-
for b in range(a + 1, (n - a) // 2):
48+
for a in range(1, n // 3 + 1):
49+
for b in range(a + 1, (n - a) // 2 + 1):
5050
if (
5151
squares[a] + squares[b] in squares_set
5252
and squares[n - a - b] == squares[a] + squares[b]

0 commit comments

Comments
 (0)