mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-22 13:36:46 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你二叉搜索树的根节点 <code>root</code> ,该树中的 <strong>恰好</strong> 两个节点的值被错误地交换。<em>请在不改变其结构的情况下,恢复这棵树 </em>。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/10/28/recover1.jpg\" style=\"width: 300px;\" />\n<pre>\n<strong>输入:</strong>root = [1,3,null,null,2]\n<strong>输出:</strong>[3,1,null,null,2]\n<strong>解释:</strong>3 不能是 1 的左孩子,因为 3 > 1 。交换 1 和 3 使二叉搜索树有效。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/10/28/recover2.jpg\" style=\"height: 208px; width: 400px;\" />\n<pre>\n<strong>输入:</strong>root = [3,1,4,null,null,2]\n<strong>输出:</strong>[2,1,4,null,null,3]\n<strong>解释:</strong>2 不能在 3 的右子树中,因为 2 < 3 。交换 2 和 3 使二叉搜索树有效。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>树上节点的数目在范围 <code>[2, 1000]</code> 内</li>\n\t<li><code>-2<sup>31</sup> <= Node.val <= 2<sup>31</sup> - 1</code></li>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong>使用 <code>O(n)</code> 空间复杂度的解法很容易实现。你能想出一个只使用 <code>O(1)</code> 空间的解决方案吗?</p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 685,
|
||||
"likes": 688,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"93.2K\", \"totalSubmission\": \"153.7K\", \"totalAcceptedRaw\": 93211, \"totalSubmissionRaw\": 153695, \"acRate\": \"60.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"93.5K\", \"totalSubmission\": \"154.3K\", \"totalAcceptedRaw\": 93545, \"totalSubmissionRaw\": 154321, \"acRate\": \"60.6%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user