https://projecteuler.net/problem=24
Python allows for a remarkably compact solution to this one. First call permutations on a string of the 0-9 digits. Then join them all to a string, which we ultimately map the int function onto. Then we return the millionth element of the sorted list.
from itertools import permutations
def problem24():
vals = list(permutations('0123456789'))
vals = ["".join(x) for x in vals]
vals = list(map(int, vals))
final = sorted(vals)
return final[1000000]
2783915604
In questa pagina del sito puoi guardare il video online Project Euler 24 Lexicographic Permutations in Python della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Jeffrey James 03 febbraio 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,996 volte e gli è piaciuto 10 spettatori. Buona visione!