🔥✅✅ Dart Solution 📌📌 || with Explanation 👌👌
Solution
Initialization: We start by getting the length of the array n and initializing sum to 0.
Loop through elements: We iterate from 1 to n (1-based index).
# Solution

1. **Initialization**: We start by getting the length of the array `n` and initializing `sum` to 0.
2. **Loop through elements**: We iterate from 1 to n (1-based index).
3. **Check special condition**: For each index `i`, we check if it divides `n` (n % i == 0).
4. **Sum squares**: For each special element found (at index `i-1` in 0-based), we square it and add to the sum.
5. **Return result**: After processing all elements, we return the accumulated sum.

### Time Complexity

- **Time Complexity**: O(n), where n is the length of the input array.
    - We perform a single pass through the array (n iterations).
    - For each iteration, we perform a constant-time check (n % i) and potentially a constant-time addition and multiplication.
    - Therefore, the overall time complexity is linear with respect to the input size.
- **Space Complexity**: O(1)
    - We only use a constant amount of additional space (for variables `n`, `sum`, and `i`).

```dart
class Solution {
  int sumOfSquares(List<int> nums) {
    int n = nums.length;
    int sum = 0;
    for (int i = 1; i <= n; i++) {
        if (n % i == 0) {
            sum += nums[i - 1] * nums[i - 1];
        }
    }
    return sum;
    }
}
```
['Array', 'Enumeration', 'Dart']