1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-25 14:58:56 +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>学校打算为全体学生拍一张年度纪念照。根据要求,学生需要按照 <strong>非递减</strong> 的高度顺序排成一行。</p>\n\n<p>排序后的高度情况用整数数组 <code>expected</code> 表示,其中 <code>expected[i]</code> 是预计排在这一行中第 <code>i</code> 位的学生的高度(<strong>下标从 0 开始</strong>)。</p>\n\n<p>给你一个整数数组 <code>heights</code> ,表示 <strong>当前学生站位</strong> 的高度情况。<code>heights[i]</code> 是这一行中第 <code>i</code> 位学生的高度(<strong>下标从 0 开始</strong>)。</p>\n\n<p>返回满足<em> </em><code>heights[i] != expected[i]</code> 的 <strong>下标数量</strong> 。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例:</strong></p>\n\n<pre>\n<strong>输入:</strong>heights =&nbsp;[1,1,4,2,1,3]\n<strong>输出:</strong>3 \n<strong>解释:</strong>\n高度[1,1,<em><strong>4</strong></em>,2,<em><strong>1</strong></em>,<em><strong>3</strong></em>]\n预期[1,1,<em><strong>1</strong></em>,2,<em><strong>3</strong></em>,<em><strong>4</strong></em>]\n下标 2 、4 、5 处的学生高度不匹配。</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>heights = [5,1,2,3,4]\n<strong>输出:</strong>5\n<strong>解释:</strong>\n高度[<em><strong>5</strong></em>,<em><strong>1</strong></em>,<em><strong>2</strong></em>,<em><strong>3</strong></em>,<em><strong>4</strong></em>]\n预期[<em><strong>1</strong></em>,<em><strong>2</strong></em>,<em><strong>3</strong></em>,<em><strong>4</strong></em>,<em><strong>5</strong></em>]\n所有下标的对应学生高度都不匹配。</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>heights = [1,2,3,4,5]\n<strong>输出:</strong>0\n<strong>解释:</strong>\n高度[1,2,3,4,5]\n预期[1,2,3,4,5]\n所有下标的对应学生高度都匹配。</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= heights.length &lt;= 100</code></li>\n\t<li><code>1 &lt;= heights[i] &lt;= 100</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 99,
"likes": 101,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"34.4K\", \"totalSubmission\": \"45.4K\", \"totalAcceptedRaw\": 34377, \"totalSubmissionRaw\": 45378, \"acRate\": \"75.8%\"}",
"stats": "{\"totalAccepted\": \"35K\", \"totalSubmission\": \"46.2K\", \"totalAcceptedRaw\": 35045, \"totalSubmissionRaw\": 46209, \"acRate\": \"75.8%\"}",
"hints": [
"Build the correct order of heights by sorting another array, then compare the two arrays."
],