@@ -0,0 +1,649 @@
+%22%22%22%0AA permutation is an ordered arrangement of objects. For example, 3124 is one%0Apossible permutation of the digits 1, 2, 3 and 4. If all of the permutations%0Aare listed numerically or alphabetically, we call it lexicographic order. The%0Alexicographic permutations of 0, 1 and 2 are:%0A 012   021   102   120   201   210%0AWhat is the millionth lexicographic permutation of the digits %0A0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?%0A%22%22%22%0A%0Aimport itertools%0A%0Adef solve_p024():%0A    permutations = itertools.permutations((0,1,2,3,4,5,6,7,8,9), 10)%0A    return reduce(lambda x,y: str(x) + str(y), list(permutations)%5B999999%5D )%0A%0Aif __name__ == '__main__':%0A    print solve_p024()

solving p024