Skip to content

Instantly share code, notes, and snippets.

@daclouds
Created May 13, 2013 10:22
Show Gist options
  • Save daclouds/49c16667ae43b7a84130 to your computer and use it in GitHub Desktop.
Save daclouds/49c16667ae43b7a84130 to your computer and use it in GitHub Desktop.
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