← ALL NOTES
Array

2778. Sum of Squares of Special Elements

"Special" here says nothing about the values in the array. It is a claim about positions: index i is special when it divides n, the length. So the set of elements that matter is fixed before you look at a single number — it is exactly the divisor set of n — and the values only get squared and added.

Loading…