Simple java code 1 ms beats 100 %
\n# Complexity\n- \n\n# Code\n\nclass Solution {\n    public int sumOfSquares(int[] arr) {\n        int n=arr.length;\n        int sum=0;\n        for(int i=0;i
\n# Complexity\n- \n![image.png](https://assets.leetcode.com/users/images/c8701ed2-d3fc-406f-93af-b29567131674_1703341229.3121667.png)\n# Code\n```\nclass Solution {\n    public int sumOfSquares(int[] arr) {\n        int n=arr.length;\n        int sum=0;\n        for(int i=0;i<n;i++){\n            if(n%(i+1)==0){\n                sum+=arr[i]*arr[i];\n            }\n        }\n        return sum;\n    }\n}\n```
['Java']