Tap here to switch tabs
Problem
Submissions

Problem: Sum of Squares of Special Elements

Sum of Squares of Special Elements asks you to find the array values whose one-based positions divide the array length, then return the sum of their squares.

Statement

You are given a 11-indexed integer array nums of length n.

An element nums[i] is considered special if i divides n evenly, meaning n % i == 0.

Return the sum of the squares of all special elements in nums.

Constraints:

  • 1≤1 \leq nums.length == n ≤50\leq 50

  • 1≤1 \leq nums[i] ≤50\leq 50

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sum of Squares of Special Elements

Sum of Squares of Special Elements asks you to find the array values whose one-based positions divide the array length, then return the sum of their squares.

Statement

You are given a 11-indexed integer array nums of length n.

An element nums[i] is considered special if i divides n evenly, meaning n % i == 0.

Return the sum of the squares of all special elements in nums.

Constraints:

  • 1≤1 \leq nums.length == n ≤50\leq 50

  • 1≤1 \leq nums[i] ≤50\leq 50