Return 1×1 + 2×2 + ... + n×n. For n = 3 that is 1 + 4 + 9 = 14.
int sumOfSquares(int n)
Examples
There are also 4 hidden tests you can't see. Solve the problem, not the examples.