5 lines
163 B
Python
5 lines
163 B
Python
class Solution:
|
|
def sumOfSquares(self, nums: List[int]) -> int:
|
|
n = len(nums)
|
|
return sum(x**2 for (i, x) in enumerate(nums) if n % (i+1) == 0)
|