Easy Python Solution. Beats 99 %
Intuition\n Describe your first thoughts on how to solve this problem. \n# There is a catch. i = the natural number representing the position of an element is t
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n# **There is a catch. i = the natural number representing the position of an element is the array. Starts with 1 but not with 0**\n# Approach\n<!-- Describe your approach to solving the problem. -->\nIterate throgh the array with the condition.\nSave squared element to the answer variable.\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```python []\nclass Solution:\n    def sumOfSquares(self, nums: List[int]) -> int:\n        ans = 0\n        n = len(nums)\n\n        for i in range(len(nums)):     \n            if n % (i + 1) == 0:\n                ans += nums[i] ** 2\n            \n        return ans\n        \n```\n```javascript []\nvar sumOfSquares = function(nums) {\n    n = nums.length;\n    ans = 0;\n    \n    for (let i=0; i<n; i++) {\n        if (n % (i + 1) === 0 ) {\n            ans += nums[i] ** 2;\n        }\n    }\n    return ans;\n};\n```\n\n
['Array', 'Python3', 'JavaScript']