1390. Four Divisors
https://leetcode.com/problems/four-divisors/
Given an integer array nums
, return the sum of divisors of the integers in that array that have exactly four divisors.
If there is no such integer in the array, return 0
.
Example 1:
Constraints:
1 <= nums.length <= 10^4
1 <= nums[i] <= 10^5
给定数组,返回有且只有四个除数的元素的除数之和。除数分布在square root两边,因此从平方根往下遍历到2,看是否只有一次能够整除。
Last updated
Was this helpful?