Project Euler Problem 024
import Data.List perms :: Eq a => [a] -> [[a]] perms []=[[]] perms l = [x:xs|x<-l,xs<-perms(l\\[x])] -- 3sec ans1 :: [Char] ans1 = perms "0123456789" !! 999999 -- "2783915460" ok。3sec in interpreter -- 6sec ans2 :: [Char] ans2= (sort $ permutations "0123456789")!!999999 -- 2783915460 main :: IO () main = print ans1