Skip to content

Instantly share code, notes, and snippets.

@outsideris
Created June 16, 2013 01:04
Show Gist options
  • Save outsideris/5790277 to your computer and use it in GitHub Desktop.
Save outsideris/5790277 to your computer and use it in GitHub Desktop.
euler problem 9
(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