Skip to content

Instantly share code, notes, and snippets.

@dysinger
Created September 18, 2013 18:34
Show Gist options
  • Select an option

  • Save dysinger/6613473 to your computer and use it in GitHub Desktop.

Select an option

Save dysinger/6613473 to your computer and use it in GitHub Desktop.
main :: IO ()
main = putStrLn $ show $ solution 3 5 999
where allNums max' = [1..(max' :: Int)]
divisible x y = y `mod` x == 0
divisible2 x y = (\n -> (divisible x n) || (divisible y n))
solution x y max' = sum $ filter (divisible2 x y) (allNums max')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment