Implement the provided method rangeQuadraticSum that takes range borders (fromIncl is inclusive, toExcl is exclusive) and calculates the sum of the squares of the elements which belong to the range.
Please, use streams to solve the problem.
Implement the provided method rangeQuadraticSum that takes range borders (fromIncl is inclusive, toExcl is exclusive) and calculates the sum of the squares of the elements which belong to the range.
Please, use streams to solve the problem.
Sample Input 1:
10 12Sample Output 1:
221Sample Input 2:
5 6Sample Output 2:
25Sample Input 3:
3 3Sample Output 3:
0Create a free account to access the full topic