1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 07:21:40 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 16:56:27 +08:00
parent e730aa6794
commit ad15da05aa
2517 changed files with 7358 additions and 7332 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个含 <code>n</code> 个整数的数组 <code>nums</code> ,其中 <code>nums[i]</code> 在区间 <code>[1, n]</code> 内。请你找出所有在 <code>[1, n]</code> 范围内但没有出现在 <code>nums</code> 中的数字,并以数组的形式返回结果。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [4,3,2,7,8,2,3,1]\n<strong>输出:</strong>[5,6]\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,1]\n<strong>输出:</strong>[2]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>n == nums.length</code></li>\n\t<li><code>1 <= n <= 10<sup>5</sup></code></li>\n\t<li><code>1 <= nums[i] <= n</code></li>\n</ul>\n\n<p><strong>进阶:</strong>你能在不使用额外空间且时间复杂度为<em> </em><code>O(n)</code><em> </em>的情况下解决这个问题吗? 你可以假定返回的数组不算在额外空间内。</p>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 937,
"likes": 939,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[{\"title\": \"First Missing Positive\", \"titleSlug\": \"first-missing-positive\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u7f3a\\u5931\\u7684\\u7b2c\\u4e00\\u4e2a\\u6b63\\u6570\"}, {\"title\": \"Find All Duplicates in an Array\", \"titleSlug\": \"find-all-duplicates-in-an-array\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u6570\\u7ec4\\u4e2d\\u91cd\\u590d\\u7684\\u6570\\u636e\"}]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"176.5K\", \"totalSubmission\": \"269.8K\", \"totalAcceptedRaw\": 176510, \"totalSubmissionRaw\": 269834, \"acRate\": \"65.4%\"}",
"stats": "{\"totalAccepted\": \"177.2K\", \"totalSubmission\": \"270.9K\", \"totalAcceptedRaw\": 177227, \"totalSubmissionRaw\": 270884, \"acRate\": \"65.4%\"}",
"hints": [
"This is a really easy problem if you decide to use additional memory. For those trying to write an initial solution using additional memory, think <b>counters!</b>",
"However, the trick really is to not use any additional space than what is already available to use. Sometimes, multiple passes over the input array help find the solution. However, there's an interesting piece of information in this problem that makes it easy to re-use the input array itself for the solution.",