Created
June 16, 2013 01:04
-
-
Save outsideris/5790277 to your computer and use it in GitHub Desktop.
euler problem 9
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
(for { | |
a <- 1 until 1000 | |
b <- a + 1 until 1000 | |
c = 1000 - a - b | |
if (c > b) | |
if (a * a + b * b == c * c) | |
} yield (a, b, c)).map( x => x._1 * x._2 * x._3) | |
// Vector(31875000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment