[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-10-13 19:05:28 +00:00
parent 16891693c9
commit 1baeb758ee

View File

@ -64,9 +64,9 @@ def solution(n: int = 1000) -> int:
for b in range(n // 2 - 1, n // 3, -2): for b in range(n // 2 - 1, n // 3, -2):
for a in range(b - 1, 0, -2): for a in range(b - 1, 0, -2):
c = n - b - a c = n - b - a
if b > c: # constraint a < b < c should be satisfied if b > c: # constraint a < b < c should be satisfied
continue continue
if a**2 + b**2 == c**2: # is it a pythagorean triplet if a**2 + b**2 == c**2: # is it a pythagorean triplet
return a * b * c return a * b * c