MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / slow_solution

Function slow_solution

project_euler/problem_145/sol1.py:80–93  ·  view source on GitHub ↗

To evaluate the solution, use solution() >>> slow_solution(3) 120 >>> slow_solution(6) 18720 >>> slow_solution(7) 68720

(max_power: int = 9)

Source from the content-addressed store, hash-verified

78
79
80def slow_solution(max_power: int = 9) -> int:
81 """
82 To evaluate the solution, use solution()
83 >>> slow_solution(3)
84 120
85 >>> slow_solution(6)
86 18720
87 >>> slow_solution(7)
88 68720
89 """
90 result = 0
91 for length in range(1, max_power + 1):
92 result += slow_reversible_numbers(length, 0, [0] * length, length)
93 return result
94
95
96def reversible_numbers(

Callers

nothing calls this directly

Calls 1

slow_reversible_numbersFunction · 0.85

Tested by

no test coverage detected