re: Daily Coding Puzzles VIEW POST

VIEW FULL DISCUSSION

Day 4

sumEvenFib :: Integer -> Integer
sumEvenFib x = sum . takeWhile (<x) . filter even $ fibs
  where fibs = 1 : 1 : zipWith (+) fibs (tail fibs)

main :: IO ()
main = print $ sumEvenFib 4000000
code of conduct - report abuse