Unified numbers and output
This commit is contained in:
@@ -5,7 +5,7 @@ Created on 25 Jul 2022
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 62 of Project Euler
|
||||
Solution for problem 062 of Project Euler
|
||||
https://projecteuler.net/problem=62
|
||||
"""
|
||||
|
||||
@@ -14,7 +14,7 @@ from collections import defaultdict
|
||||
from utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 62")
|
||||
@timeit("Problem 062")
|
||||
def compute():
|
||||
"""
|
||||
The cube, 41063625 (345^3), can be permuted to produce two other cubes:
|
||||
@@ -31,9 +31,8 @@ def compute():
|
||||
cube_str = "".join(sorted(list(str(number**3))))
|
||||
cubes[cube_str].append(number**3)
|
||||
if len(cubes[cube_str]) == 5:
|
||||
|
||||
return min(cubes[cube_str])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 62 is {compute()}")
|
||||
print(f"Result for Problem 062: {compute()}")
|
||||
|
||||
Reference in New Issue
Block a user