Easy to Understand Java Code || Beats 100%
Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\n\nclass Solution {\n    public int sumOfSquares(int[] nums) {\n        int ans = 0;\n  
# Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\n```\nclass Solution {\n    public int sumOfSquares(int[] nums) {\n        int ans = 0;\n        for(int i=0; i<nums.length; i++){\n            if(nums.length % (i+1) == 0){\n                ans += nums[i] * nums[i];\n            }\n        }\n\n        return ans;\n    }\n}\n```
['Java']