1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-21 13:06:47 +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>arr</code>,请你将该数组中出现的每个零都复写一遍,并将其余的元素向右平移。</p>\n\n<p>注意:请不要在超过该数组长度的位置写入元素。</p>\n\n<p>要求:请对输入的数组&nbsp;<strong>就地&nbsp;</strong>进行上述修改,不要从函数返回任何东西。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><strong>输入:</strong>[1,0,2,3,0,4,5,0]\n<strong>输出:</strong>null\n<strong>解释:</strong>调用函数后,<strong>输入</strong>的数组将被修改为:[1,0,0,2,3,0,0,4]\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><strong>输入:</strong>[1,2,3]\n<strong>输出:</strong>null\n<strong>解释:</strong>调用函数后,<strong>输入</strong>的数组将被修改为:[1,2,3]\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ol>\n\t<li><code>1 &lt;= arr.length &lt;= 10000</code></li>\n\t<li><code>0 &lt;= arr[i] &lt;= 9</code></li>\n</ol>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 112,
"likes": 114,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -131,7 +131,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"22.2K\", \"totalSubmission\": \"38K\", \"totalAcceptedRaw\": 22152, \"totalSubmissionRaw\": 38016, \"acRate\": \"58.3%\"}",
"stats": "{\"totalAccepted\": \"22.6K\", \"totalSubmission\": \"38.9K\", \"totalAcceptedRaw\": 22642, \"totalSubmissionRaw\": 38926, \"acRate\": \"58.2%\"}",
"hints": [
"This is a great introductory problem for understanding and working with the concept of in-place operations. The problem statement clearly states that we are to modify the array in-place. That does not mean we cannot use another array. We just don't have to return anything.",
"A better way to solve this would be without using additional space. The only reason the problem statement allows you to make modifications in place is that it hints at avoiding any additional memory.",