Returns the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. >>> solution() '2783915460'
()
| 14 | |
| 15 | |
| 16 | def solution(): |
| 17 | """Returns the millionth lexicographic permutation of the digits 0, 1, 2, |
| 18 | 3, 4, 5, 6, 7, 8 and 9. |
| 19 | |
| 20 | >>> solution() |
| 21 | '2783915460' |
| 22 | """ |
| 23 | result = list(map("".join, permutations("0123456789"))) |
| 24 | return result[999999] |
| 25 | |
| 26 | |
| 27 | if __name__ == "__main__": |