Skip to content

Instantly share code, notes, and snippets.

@jaredcacurak
Created February 24, 2011 02:19
Show Gist options
  • Save jaredcacurak/841631 to your computer and use it in GitHub Desktop.
Save jaredcacurak/841631 to your computer and use it in GitHub Desktop.
A Groovy solution for Project Euler - Problem 5
BigInteger.metaClass.lcm = { number, value = longValue() ->
number * value / gcd(number) as BigInteger
}
(1..20).inject 1, { BigInteger result, it -> result.lcm it }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment