Created
May 18, 2017 17:41
-
-
Save anonymous/6e4b93f907407f67704430e60f771e1f to your computer and use it in GitHub Desktop.
Rust code shared from the playground
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
extern crate num_integer; | |
use num_integer::Integer; | |
fn main() { | |
let e5 = euler5(); | |
assert_eq!(e5, 232792560); | |
println!("Euler5 {}", e5); | |
} | |
fn euler5() -> u64 { | |
(2u64..20).fold(1, |acc, x| acc.lcm(&x)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment