Sponsored
Sponsored
Solve with full IDE support and test cases
Use these hints if you're stuck. Try solving on your own first.
Iterate over all the elements of the array. For each index i, check if it is special using the modulo operator.
if n%i == 0, index i is special and you should add nums[i] to the answer.