C++ || One Pass || O(N)
IntuitionApproachComplexity
Time complexity:
O(N)
Space complexity:
O(1)Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
O(N)

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
O(1)

# Code
```cpp []
class Solution {
public:
    int sumOfSquares(vector<int>& nums) {

        int n=nums.size();
        int res=0;

        for(int i=0;i<n;i++)
        {
            if(n%(i+1)==0)
                res=res+nums[i]*nums[i];
        }

        return res;
        
    }
};
```
['C++']