-
-
Save dholbrook/2ffd27ddc4170eb86e1fb42ab509a282 to your computer and use it in GitHub Desktop.
Rust code shared from the playground
This file contains hidden or 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; | |
// run at http://play.integer32.com/?gist=6e4b93f907407f67704430e60f771e1f&version=undefined | |
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