✅Simple  || JAVA || easy to understand || Beats 100%✅
IntuitionInitialization:Start by initializing a variable ans to 0. This variable will hold the cumulative sum of the squares of selected elements from the array
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Initialization:

Start by initializing a variable ans to 0. This variable will hold the cumulative sum of the squares of selected elements from the array.
# Approach
<!-- Describe your approach to solving the problem. -->
Iterate Through Array:

Loop through each element in the array using an index i from 0 to nums.length - 1.

Check Divisibility:

For each index i, compute i + 1 and check if nums.length % (i + 1) == 0. This checks whether i + 1 is a divisor of the length of the array.

Update Sum:

If the condition is true, it means that the position (index i) should contribute to the final sum. Compute the square of nums[i] and add it to ans.
# Complexity
- Time complexity: O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
# Code
```java []
class Solution {
    public int sumOfSquares(int[] nums) {
        int n= nums.length;
        int special =0;
        for(int i=0; i<nums.length; i++){
            if(n % (i+1)==0){
                special += nums[i]*nums[i];
            }
        }
        return special;
    }
}
```
['Java']