Skip to content

Instantly share code, notes, and snippets.

@kazua
Created January 2, 2013 13:34
Show Gist options
  • Save kazua/4434620 to your computer and use it in GitHub Desktop.
Save kazua/4434620 to your computer and use it in GitHub Desktop.
Project Euler Problem 52
//http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%2052
//K.A
object problem52 {
def getPosInt(mc : Int) : BigInt = {
Stream.from(1).takeWhile(i => (2 to mc).map(j => (j * i).toString.toList).filter(_.diff(i.toString.toList).size > 0).isEmpty == false).max + 1
}
def main(args : Array[String]) {
println(getPosInt(6))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment