Created
May 13, 2012 14:30
-
-
Save onlyshk/2688689 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
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