Skip to content

Instantly share code, notes, and snippets.

@kazua
Created January 17, 2013 12:52
Show Gist options
  • Save kazua/4555746 to your computer and use it in GitHub Desktop.
Save kazua/4555746 to your computer and use it in GitHub Desktop.
Project Euler Problem 38
//http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%2038
//K.A
object problem38 {
def problem38 = (1 to 9999).map(i => (1 to 9).map(j => (1 to j).map(k => i * k).mkString)).flatten.filter(n => n.length == 9 && (1 to 9).map(m => n.indexOf(m.toString)).forall(_ >= 0)).max
def main(args : Array[String]) {
println(problem38)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment