mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-10 07:45:54 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
16891693c9
commit
1baeb758ee
@ -64,9 +64,9 @@ def solution(n: int = 1000) -> int:
|
||||
for b in range(n // 2 - 1, n // 3, -2):
|
||||
for a in range(b - 1, 0, -2):
|
||||
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
|
||||
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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user