Unified numbers and output

This commit is contained in:
2023-04-01 16:04:44 +02:00
parent 220a742b6b
commit 4ffdf12329
13 changed files with 43 additions and 45 deletions

View File

@@ -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()}")