From c1fdcdb656551c6c0c22048f280db557e13bdc86 Mon Sep 17 00:00:00 2001 From: Tekunov Daniil Date: Fri, 15 Jun 2018 11:31:05 +0300 Subject: [PATCH] Create Problem9.scala --- scala/Problem9.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 scala/Problem9.scala 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) +}