Sum of Squares of Divisible Elements

Given an array(1-indexed) nums of length n, where n is a positive integer, each element nums[i] is considered special if it evenly divides n (i.e., n % i == 0).

Your task is to find and sum the squares and print the resultant sum of all such special elements in the array.

Ada AI

I want to discuss a solution

Help me solve this

Give more examples

What's wrong with my code?

How to use 'for loop' in javascript?