Skip to content

Instantly share code, notes, and snippets.

@2GMon
Created August 7, 2012 04:56
Show Gist options
  • Save 2GMon/3281752 to your computer and use it in GitHub Desktop.
Save 2GMon/3281752 to your computer and use it in GitHub Desktop.
-- Project Euler : Problem 16
import Data.Char
power :: Integer
power = 2 ^ 1000
digitList :: Integer -> [Int]
digitList x = map digitToInt $ show x
main = print $ sum $ digitList power
-- 1366
-- ./dailycoding16 0.00s user 0.00s system 0% cpu 0.003 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment