Project Euler Problem #24 Solution
This code gets the millionth lexicographic permutation of (0, 1, 2, 3, 4, 5, 6, 7, 8, 9):
from itertools import permutations MILLIONTH = 10 ** 6 - 1 print reduce(lambda x, y: str(x) + str(y), list(permutations(range(10), 10))[MILLIONTH])
Advertisement
