It only takes one line code to solve Problem 4 of Project Euler in Scala (and many other functional programming languages):
((for (x <- 100 until 1000; y <- x until 1000) yield x * y) filter (x => x.toString == x.toString.reverse)).max
Advertisement
Tags: functional programming, programming, project euler, scala