Skip to content

Commit

Permalink
add euler039 solution
Browse files Browse the repository at this point in the history
  • Loading branch information
kailanefelix committed Sep 30, 2021
1 parent 1cf2841 commit 8b233dc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions euler0XX/euler039.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
max_count, max_p = 0, 0

for p in range(12, 1000, 2):
count = 0

for a in range(1, p // 3):
for b in range(a, 2 * (p // 3) - a):
c = p - a - b
if c * c == a * a + b * b:
count = count + 1

if count > max_count:
max_count, max_p = count, p

print(max_p)

0 comments on commit 8b233dc

Please sign in to comment.