diff --git a/scala/Problem9.scala b/scala/Problem9.scala new file mode 100644 index 0000000..37395a4 --- /dev/null +++ b/scala/Problem9.scala @@ -0,0 +1,12 @@ +object Main extends App { + + //O(n^3) + def task = + for { + a <- 1 until 1000 + b <- a until 1000 + c <- b until 1000 + if a * a + b * b == c * c && a + b + c == 1000 + } yield a * b * c + print(task.head) +}