2778. Sum of Squares of Special Elements
You are given a 1-indexed integer array
nums
of lengthn
.An element
nums[i]
ofnums
is called special ifi
dividesn
, i.e.n % i == 0
.Return the sum of the squares of all special elements of
nums
.
1 | class Solution { |