[C++] || Easy Solution
\n# Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n
\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int sumOfSquares(vector<int>& nums) {\n        int sum = 0, n=nums.size();\n        \n        for(int i=0; i<nums.size(); i++)\n        {\n            if(n%(i+1) == 0)\n                sum += nums[i]*nums[i];\n        }\n        \n        return sum;\n    }\n};\n```
['C++']