diff --git a/src/Python/Problems001-050/Problem024.py b/src/Python/Problems001-050/Problem024.py index 27e5d6f..a41bb49 100644 --- a/src/Python/Problems001-050/Problem024.py +++ b/src/Python/Problems001-050/Problem024.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python """ Created on 11 Sep 2019 @@ -10,6 +10,7 @@ https://projecteuler.net/problem=24 """ from itertools import permutations + from utils import timeit @@ -26,11 +27,12 @@ def compute(): What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9? """ + digits = list(range(10)) _permutations = list(permutations(digits)) - return "".join(str(digit) for digit in _permutations[999999]) + + return "".join(str(digit) for digit in _permutations[999_999]) if __name__ == "__main__": - - print(f"Result for Problem 24: {compute()}") \ No newline at end of file + print(f"Result for Problem 24 is {compute()}")