Skip to content

Instantly share code, notes, and snippets.

@jaredcacurak
Created February 24, 2011 02:29
Show Gist options
  • Save jaredcacurak/841642 to your computer and use it in GitHub Desktop.
Save jaredcacurak/841642 to your computer and use it in GitHub Desktop.
A Groovy solution for Project Euler - Problem 4
(999..100).inject 0, { max, a ->
(a..100).each { b ->
String product = a * b
if (product.reverse() == product)
max = [max, product as Integer].max()
}
max
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment