1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 22:13:28 +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>给你一个正整数的数组 <code>A</code>(其中的元素不一定完全不同),请你返回可在 <strong>一次交换</strong>(交换两数字 <code>A[i]</code> 和 <code>A[j]</code> 的位置)后得到的、按字典序排列小于 <code>A</code> 的最大可能排列。</p>\n\n<p>如果无法这么操作,就请返回原数组。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [3,2,1]\n<strong>输出:</strong>[3,1,2]\n<strong>解释:</strong>交换 2 和 1\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [1,1,5]\n<strong>输出:</strong>[1,1,5]\n<strong>解释:</strong>已经是最小排列\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [1,9,4,6,7]\n<strong>输出:</strong>[1,7,4,6,9]\n<strong>解释:</strong>交换 9 和 7\n</pre>\n\n<p><strong>示例 4</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [3,1,1,3]\n<strong>输出:</strong>[1,3,1,3]\n<strong>解释:</strong>交换 1 和 3\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= arr.length <= 10<sup>4</sup></code></li>\n\t<li><code>1 <= arr[i] <= 10<sup>4</sup></code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 37,
"likes": 39,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"6.6K\", \"totalSubmission\": \"14.2K\", \"totalAcceptedRaw\": 6583, \"totalSubmissionRaw\": 14240, \"acRate\": \"46.2%\"}",
"stats": "{\"totalAccepted\": \"6.7K\", \"totalSubmission\": \"14.4K\", \"totalAcceptedRaw\": 6672, \"totalSubmissionRaw\": 14426, \"acRate\": \"46.2%\"}",
"hints": [
"You need to swap two values, one larger than the other. Where is the larger one located?"
],