Created
September 24, 2014 04:32
-
-
Save etscrivner/6d2871911646e2aa979d to your computer and use it in GitHub Desktop.
Euler problem 1 in ocaml
This file contains 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
let result = List.range 1 1000 | |
|> List.filter ~f:(fun n -> (n mod 3) = 0 || (n mod 5) = 0) | |
|> List.reduce ~f:(+);; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment