Created
June 18, 2009 03:46
-
-
Save cmoore/131687 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Check the actual problem for this 1000 digit number. | |
p8 :: String | |
p8 = "73167176531330624..." | |
p8_five [] = [] | |
p8_five x = take 5 x : p8_five ( tail x ) | |
-- Take a string, break it into seperate integers, and then get a product of those integers. | |
prod_char x = product $ map digitToInt x | |
problem_eight :: Int | |
problem_eight = maximum $ map prod_char $ p8_five p8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment