Skip to content

Instantly share code, notes, and snippets.

Created May 18, 2017 17:41
Show Gist options
  • Save anonymous/6e4b93f907407f67704430e60f771e1f to your computer and use it in GitHub Desktop.
Save anonymous/6e4b93f907407f67704430e60f771e1f to your computer and use it in GitHub Desktop.
Rust code shared from the playground
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