Sum of Squares of Special Elements || C++
\n\n# Code\n\nclass Solution {\npublic:\n    int sumOfSquares(vector<int>& nums) {\n        int ans=0;\n        int n=nums.size();\n        for(int i=0;i<n;i++)
\n\n# Code\n```\nclass Solution {\npublic:\n    int sumOfSquares(vector<int>& nums) {\n        int ans=0;\n        int n=nums.size();\n        for(int i=0;i<n;i++)\n        {\n            if(n%(i+1)==0)\n            {\n                ans+=nums[i]*nums[i];\n            }\n        }\n        return ans;\n    }\n};\n```
['Array', 'Math', 'C', 'C++']