Unified numbers and output
This commit is contained in:
@@ -5,7 +5,7 @@ Created on 04 Dic 2021
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 60 of Project Euler
|
||||
Solution for problem 060 of Project Euler
|
||||
https://projecteuler.net/problem=60
|
||||
"""
|
||||
|
||||
@@ -22,7 +22,6 @@ def solve_backtrack(max_chain_length, chain):
|
||||
return chain
|
||||
solve_backtrack(max_chain_length, chain)
|
||||
chain.pop()
|
||||
|
||||
return chain
|
||||
|
||||
|
||||
@@ -32,11 +31,10 @@ def is_concatenable(chain, candidate):
|
||||
return False
|
||||
if not is_prime(int(str(candidate) + str(n))):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@timeit("Problem 60")
|
||||
@timeit("Problem 060")
|
||||
def compute():
|
||||
"""
|
||||
The primes 3, 7, 109, and 673, are quite remarkable. By taking any two
|
||||
@@ -50,8 +48,9 @@ def compute():
|
||||
"""
|
||||
|
||||
ans = solve_backtrack(5, [])
|
||||
|
||||
return sum(ans)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 60 is {compute()}")
|
||||
print(f"Result for Problem 060: {compute()}")
|
||||
|
||||
Reference in New Issue
Block a user