Skip to content

Commit d64377f

Browse files
committed
Moved solution explanation to module-level docstring
1 parent 908914e commit d64377f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

project_euler/problem_075/sol1.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
2121
Given that L is the length of the wire, for how many values of L ≤ 1,500,000 can
2222
exactly one integer sided right angle triangle be formed?
23+
24+
Solution: we generate all pythagorean triples using Euclid's formula and
25+
keep track of the frequencies of the perimeters.
26+
27+
Reference: https://en.wikipedia.org/wiki/Pythagorean_triple#Generating_a_triple
2328
"""
2429

2530
from collections import defaultdict
@@ -37,10 +42,6 @@ def solution(limit: int = 1500000) -> int:
3742
112
3843
>>> solution(50000)
3944
5502
40-
41-
Solution: we generate all pythagorean triples using Euclid's formula and
42-
keep track of the frequencies of the perimeters.
43-
Reference: https://en.wikipedia.org/wiki/Pythagorean_triple#Generating_a_triple
4445
"""
4546
frequencies: DefaultDict = defaultdict(int)
4647
euclid_m = 2

0 commit comments

Comments
 (0)