MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / solution

Function solution

project_euler/problem_024/sol1.py:16–24  ·  view source on GitHub ↗

Returns the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. >>> solution() '2783915460'

()

Source from the content-addressed store, hash-verified

14
15
16def 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
27if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected