Created
September 16, 2012 05:52
-
-
Save pokutuna/3731184 to your computer and use it in GitHub Desktop.
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
def sumOfDigits(num: BigInt): Int = num.toString.map(_.getNumericValue).sum | |
val result = ( for (a <- 1 until 100; b <- 1 until 100) yield sumOfDigits(BigInt(a).pow(b)) ).max | |
println(result) // => 972 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment