mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 14:12:17 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p><em>这个问题和“最多能完成排序的块”相似,但给定数组中的元素可以重复,输入数组最大长度为<code>2000</code>,其中的元素最大为<code>10**8</code>。</em></p>\n\n<p><code>arr</code>是一个可能包含<strong>重复元素</strong>的整数数组,我们将这个数组分割成几个“块”,并将这些块分别进行排序。之后再连接起来,使得连接的结果和按升序排序后的原数组相同。</p>\n\n<p>我们最多能将数组分成多少块?</p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> arr = [5,4,3,2,1]\n<strong>输出:</strong> 1\n<strong>解释:</strong>\n将数组分成2块或者更多块,都无法得到所需的结果。\n例如,分成 [5, 4], [3, 2, 1] 的结果是 [4, 5, 1, 2, 3],这不是有序的数组。 \n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> arr = [2,1,3,4,4]\n<strong>输出:</strong> 4\n<strong>解释:</strong>\n我们可以把它分成两块,例如 [2, 1], [3, 4, 4]。\n然而,分成 [2, 1], [3], [4], [4] 可以得到最多的块数。 \n</pre>\n\n<p><strong>注意:</strong></p>\n\n<ul>\n\t<li><code>arr</code>的长度在<code>[1, 2000]</code>之间。</li>\n\t<li><code>arr[i]</code>的大小在<code>[0, 10**8]</code>之间。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 119,
|
||||
"likes": 120,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Max Chunks To Make Sorted\", \"titleSlug\": \"max-chunks-to-make-sorted\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u6700\\u591a\\u80fd\\u5b8c\\u6210\\u6392\\u5e8f\\u7684\\u5757\"}]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"6.9K\", \"totalSubmission\": \"13.3K\", \"totalAcceptedRaw\": 6913, \"totalSubmissionRaw\": 13270, \"acRate\": \"52.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"7.3K\", \"totalSubmission\": \"14.1K\", \"totalAcceptedRaw\": 7290, \"totalSubmissionRaw\": 14067, \"acRate\": \"51.8%\"}",
|
||||
"hints": [
|
||||
"Each k for which some permutation of arr[:k] is equal to sorted(arr)[:k] is where we should cut each chunk."
|
||||
],
|
||||
|
Reference in New Issue
Block a user