Created
January 17, 2013 12:52
-
-
Save kazua/4555746 to your computer and use it in GitHub Desktop.
Project Euler Problem 38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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