1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 19:31:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part1

This commit is contained in:
2022-03-27 20:37:52 +08:00
parent 8e542045d1
commit c554fc6908
1285 changed files with 108123 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<p>给你两个正整数&nbsp;<code>n</code>&nbsp;<code>k</code>&nbsp;</p>
<p>如果正整数 <code>i</code> 满足 <code>n % i == 0</code> ,那么我们就说正整数 <code>i</code> 是整数 <code>n</code>&nbsp;的因子。</p>
<p>考虑整数 <code>n</code>&nbsp;的所有因子,将它们 <strong>升序排列</strong>&nbsp;。请你返回第 <code>k</code>&nbsp;个因子。如果 <code>n</code>&nbsp;的因子数少于 <code>k</code>&nbsp;,请你返回 <strong>-1</strong>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>n = 12, k = 3
<strong>输出:</strong>3
<strong>解释:</strong>因子列表包括 [1, 2, 3, 4, 6, 12],第 3 个因子是 3 。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>n = 7, k = 2
<strong>输出:</strong>7
<strong>解释:</strong>因子列表包括 [1, 7] ,第 2 个因子是 7 。
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>n = 4, k = 4
<strong>输出:</strong>-1
<strong>解释:</strong>因子列表包括 [1, 2, 4] ,只有 3 个因子,所以我们应该返回 -1 。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= k &lt;= n &lt;= 1000</code></li>
</ul>