Skip to content

Instantly share code, notes, and snippets.

@kazua
Created November 27, 2012 15:59
Show Gist options
  • Save kazua/4155052 to your computer and use it in GitHub Desktop.
Save kazua/4155052 to your computer and use it in GitHub Desktop.
Project Euler Problem 05
//http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%205
//K.A
object problem05 {
def getDivMin(sl : List[Int]) : Int = {
Range(sl.last, Int.MaxValue).takeWhile(i=> !sl.forall(i % _ == 0)).max + 1
}
def main(args : Array[String]) {
val sl = (1 to 20).toList
println(getDivMin(sl))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment