Skip to content

Instantly share code, notes, and snippets.

@oskimura
Created October 1, 2010 11:59
Show Gist options
  • Save oskimura/606108 to your computer and use it in GitHub Desktop.
Save oskimura/606108 to your computer and use it in GitHub Desktop.
{-# LANGUAGE NoMonomorphismRestriction #-}
module Euler24 where
import Data.List (permutations, sort)
listToDigit xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1)
euler24 = listToDigit . f $ lst
where
f = (!!(1000000-1)) . sort . permutations
lst = [0..9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment