# -*- coding: utf-8 -*- # http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%2024 # # 順列はArray#permutationにあるので使う. i = (0 .. 9).to_a.permutation(10) (1000000 - 1).times{ i.next } puts i.next.join.to_i