Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sumSquares(n:Int):Int = {
- (1 to n).reduceLeft { (sum, curr) => sum + curr * curr }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement