dsa · easy

Sum of Odd Divisors

For each number in nums, sum its **odd** positive divisors. Return the total of those sums.

Arguments

**Example:** [1, 4, 7]1 + 1 + (1+7) = 10.

4’s odd divisors are {1} only.

Example

`` Input: [1,4,7] Output: 10 ``

Constraints

1 <= nums.length <= 1000, 1 <= nums[i] <= 10^6 Hidden tests include near-max size for this bound; a slower-than-intended solution TLEs.

Examples

Example 1

Input:
[1,4,7]

Expected:
10

Example 2

Input:
[1]

Expected:
1

Open in the Dojo editor