Skip to content

Instantly share code, notes, and snippets.

@onlyshk
Created May 13, 2012 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onlyshk/2688689 to your computer and use it in GitHub Desktop.
Save onlyshk/2688689 to your computer and use it in GitHub Desktop.
package proj_euler
object Problem6 {
def solve(): Int = {
var r1 = Range(1, 100)
var sum1 = r1.foldLeft(0)((x,y) => x + y*y)
var sum2 = r1.sum * r1.sum
return sum2 - sum1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment