Task 6 of 7 · 0 solved · 7 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

11.4 Lambdas and streams — sum of squares

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Fill in sumOfSquares using a stream so that it returns the sum of the squares.

mapToInt turns each element into an int, and sum() adds them. The program prints 30 (1+4+9+16) and then 0.

Your solution