mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 15:01:40 +08:00
国外版
This commit is contained in:
36
算法题(国外版)/four-divisors.html
Normal file
36
算法题(国外版)/four-divisors.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<p>Given an integer array <code>nums</code>, return <em>the sum of divisors of the integers in that array that have exactly four divisors</em>. If there is no such integer in the array, return <code>0</code>.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [21,4,7]
|
||||
<strong>Output:</strong> 32
|
||||
<strong>Explanation:</strong>
|
||||
21 has 4 divisors: 1, 3, 7, 21
|
||||
4 has 3 divisors: 1, 2, 4
|
||||
7 has 2 divisors: 1, 7
|
||||
The answer is the sum of divisors of 21 only.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [21,21]
|
||||
<strong>Output:</strong> 64
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [1,2,3,4,5]
|
||||
<strong>Output:</strong> 0
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= nums.length <= 10<sup>4</sup></code></li>
|
||||
<li><code>1 <= nums[i] <= 10<sup>5</sup></code></li>
|
||||
</ul>
|
Reference in New Issue
Block a user