Project Euler 8
import Control.Monad (liftM) import Data.Char (digitToInt) main = liftM (maximum . map product . sub5 . concat . lines) getContents sub5 s = [map digitToInt $ take 5 $ drop n s | (n,_) <- zip [0..length s - 5] s]
import Control.Monad (liftM) import Data.Char (digitToInt) main = liftM (maximum . map product . sub5 . concat . lines) getContents sub5 s = [map digitToInt $ take 5 $ drop n s | (n,_) <- zip [0..length s - 5] s]