import itertools
"""Assumes digits a string.returns the nth item of the lexicographic permutation of digits."""return list(itertools.permutations(digits))[n - 1]
permutation
.# The lexicographic permutations of 0, 1 and 2 are: 012 021 102 120 201 210
# What is the millionthlexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and
我正在研究euler项目的问题24,经过几天的研究,并且充分了解了什么是回溯以及如何实现它,我终于让我的置换器开始工作了,这里是:/*The lexicographic permutations of 0, 1 and 2 are:
012 021 102 120 201 210What is the millionth lexicographic permutation of th
middleString = firstWord; System.out.println("The second word in lexicographicmiddleString = secondWord; System.out.println("The second word in lexicographicmiddleString = thirdWord;
System.out.prin