Created
February 24, 2011 02:29
-
-
Save jaredcacurak/841642 to your computer and use it in GitHub Desktop.
A Groovy solution for Project Euler - Problem 4
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
(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