File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
project_euler/problem_073 Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 1818
1919from math import gcd
2020
21+
2122def slow_solution (max_d : int = 12_000 ) -> int :
2223 """
2324 Returns number of fractions lie between 1/3 and 1/2 in the sorted set
@@ -40,6 +41,7 @@ def slow_solution(max_d: int = 12_000) -> int:
4041 fractions_number += 1
4142 return fractions_number
4243
44+
4345def solution (max_d : int = 12_000 ) -> int :
4446 """
4547 Returns number of fractions lie between 1/3 and 1/2 in the sorted set
@@ -71,6 +73,7 @@ def solution(max_d: int = 12_000) -> int:
7173 fractions_number += 1
7274 return fractions_number
7375
76+
7477def benchmark () -> None :
7578 """
7679 Benchmarks
@@ -86,6 +89,7 @@ def benchmark() -> None:
8689 print (f"slow_solution : { timeit ('slow_solution()' , globals = globals (), number = 10 )} " )
8790 print (f"solution : { timeit ('solution()' , globals = globals (), number = 10 )} " )
8891
92+
8993if __name__ == "__main__" :
9094 print (f"{ solution () = } " )
9195 benchmark ()
You can’t perform that action at this time.
0 commit comments