File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
project_euler/problem_075 Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 20
20
21
21
Given that L is the length of the wire, for how many values of L ≤ 1,500,000 can
22
22
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
23
28
"""
24
29
25
30
from collections import defaultdict
@@ -37,10 +42,6 @@ def solution(limit: int = 1500000) -> int:
37
42
112
38
43
>>> solution(50000)
39
44
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
44
45
"""
45
46
frequencies : DefaultDict = defaultdict (int )
46
47
euclid_m = 2
You can’t perform that action at this time.
0 commit comments