🔥🔥Very EASY to UNDERSTAND and beginner friendly. Simple MATH.
\n\n# Complexity\n- Time complexity:\n O(n) \n\n- Space complexity:\n O(1) \n\n# Code\n\nclass Solution {\npublic:\n    int sumOfSquares(vector<int>& nums) {\n 
\n\n# Complexity\n- Time complexity:\n $$O(n)$$ \n\n- Space complexity:\n $$O(1)$$ \n\n# Code\n```\nclass Solution {\npublic:\n    int sumOfSquares(vector<int>& nums) {\n        int n=nums.size();\n        int ans=0;\n        for(int i=0;i<n;i++)\n        {\n            if(n%(i+1)==0)ans+=nums[i]*nums[i];\n        }\n        return ans;\n    }\n};\n```
['Math', 'C++']