-
-
Save daclouds/49c16667ae43b7a84130 to your computer and use it in GitHub Desktop.
This file contains 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
object Euler6 extends App { | |
def square(n: Int) = n * n | |
def difference(range: Range): Int = { | |
square(range.sum) - range.map(square).sum | |
} | |
println(difference(1 to 100)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment