1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-08 08:51:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你两个正整数&nbsp;<code>n</code> 和&nbsp;<code>k</code>&nbsp;。</p>\n\n<p>如果正整数 <code>i</code> 满足 <code>n % i == 0</code> ,那么我们就说正整数 <code>i</code> 是整数 <code>n</code>&nbsp;的因子。</p>\n\n<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>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 12, k = 3\n<strong>输出:</strong>3\n<strong>解释:</strong>因子列表包括 [1, 2, 3, 4, 6, 12],第 3 个因子是 3 。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 7, k = 2\n<strong>输出:</strong>7\n<strong>解释:</strong>因子列表包括 [1, 7] ,第 2 个因子是 7 。\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 4, k = 4\n<strong>输出:</strong>-1\n<strong>解释:</strong>因子列表包括 [1, 2, 4] ,只有 3 个因子,所以我们应该返回 -1 。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= k &lt;= n &lt;= 1000</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 22,
"likes": 23,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -137,7 +137,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"9.3K\", \"totalSubmission\": \"14.6K\", \"totalAcceptedRaw\": 9301, \"totalSubmissionRaw\": 14626, \"acRate\": \"63.6%\"}",
"stats": "{\"totalAccepted\": \"10K\", \"totalSubmission\": \"15.8K\", \"totalAcceptedRaw\": 9969, \"totalSubmissionRaw\": 15824, \"acRate\": \"63.0%\"}",
"hints": [
"The factors of n will be always in the range [1, n].",
"Keep a list of all factors sorted. Loop i from 1 to n and add i if n % i == 0. Return the kth factor if it exist in this list."