Range quadratic sum

Report a typo

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 12

Sample Output 1:

221

Sample Input 2:

5 6

Sample Output 2:

25

Sample Input 3:

3 3

Sample Output 3:

0
Write a program in Java 17
import java.util.stream.*;

class QuadraticSum {
public static long rangeQuadraticSum(int fromIncl, int toExcl) {
return 0; // write your code with streams here
}
}
___

Create a free account to access the full topic