Skip to content

Instantly share code, notes, and snippets.

@oskimura
Created September 30, 2010 04:42
Show Gist options
  • Save oskimura/604038 to your computer and use it in GitHub Desktop.
Save oskimura/604038 to your computer and use it in GitHub Desktop.
module Euler16 where
import Data.Maybe (fromMaybe)
euler16 = sum . strToInt $ text
where
num = 2 ^ 1000
text = show num
charToInteger = flip lookup (zip ['0'..'9'] [0..9])
strToInt = map (fromMaybe 0 . charToInteger)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment