O(N) & O(Sqrt(N)) Solution 
CodeCode


# Code
```java []
class Solution {
    public int sumOfSquares(int[] nums) {
        int n = nums.length;
        int sum = 0;
        for(int i = 1; i <= n; i++){
            if (n % i == 0)
                sum += nums[i-1] * nums[i-1];
        }
    return sum;
    }
}
```

# Code
```java []
class Solution {
    public int sumOfSquares(int[] nums) {
        int n = nums.length;
        int sum = 0;
        for(int i = 1; i <= Math.sqrt(n); i++){
            if (n % i == 0){
                sum += nums[i-1] * nums[i-1];
                int j = n/i;
                if (j != i)
                    sum += nums[j-1] * nums[j-1];
            }
        }
    return sum;
    }
}
['Array', 'Enumeration', 'Java']