c++ beest optimal easy solution made by self beats 100%of users
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. it is simple approach in 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->it is simple approach in this you have to remember that i starts from 1 to n we have to chech the num i divedes n or not if yes then add the element at this positoin \nbut imp thing is that the numbering starts from one but the index starts from 0 so we add the number i th positino -1 \nthen simplyiterate for loop and store in a variable sum and return sum;\n\n\n# Complexity\n- Time complexity:\n<!-- Add your time compglexity here, e.g. $$O(n)$$ -->    \nO(n)\n\n- Space complexity:\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        int n= nums.size();\n        for(int i=1 ;i<=n ;i++){\n            if(n%i ==0){\n                sum+=nums[i-1]*nums[i-1];\n            }\n        }\n        return sum;\n    }\n};\n```
['C++']