mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 23:11:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>在经典汉诺塔问题中,有 3 根柱子及 N 个不同大小的穿孔圆盘,盘子可以滑入任意一根柱子。一开始,所有盘子自上而下按升序依次套在第一根柱子上(即每一个盘子只能放在更大的盘子上面)。移动圆盘时受到以下限制:<br>\n(1) 每次只能移动一个盘子;<br>\n(2) 盘子只能从柱子顶端滑出移到下一根柱子;<br>\n(3) 盘子只能叠在比它大的盘子上。</p>\n\n<p>请编写程序,用栈将所有盘子从第一根柱子移到最后一根柱子。</p>\n\n<p>你需要原地修改栈。</p>\n\n<p><strong>示例1:</strong></p>\n\n<pre><strong> 输入</strong>:A = [2, 1, 0], B = [], C = []\n<strong> 输出</strong>:C = [2, 1, 0]\n</pre>\n\n<p><strong>示例2:</strong></p>\n\n<pre><strong> 输入</strong>:A = [1, 0], B = [], C = []\n<strong> 输出</strong>:C = [1, 0]\n</pre>\n\n<p><strong>提示:</strong></p>\n\n<ol>\n\t<li>A中盘子的数目不大于14个。</li>\n</ol>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 147,
|
||||
"likes": 152,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -125,7 +125,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"30.1K\", \"totalSubmission\": \"46K\", \"totalAcceptedRaw\": 30099, \"totalSubmissionRaw\": 46001, \"acRate\": \"65.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"31.3K\", \"totalSubmission\": \"47.9K\", \"totalAcceptedRaw\": 31263, \"totalSubmissionRaw\": 47916, \"acRate\": \"65.2%\"}",
|
||||
"hints": [
|
||||
"尝试简单构建法。",
|
||||
"你可以很容易地把最小的圆盘从一根柱子移到另一根柱子。把最小的两个圆盘从一根柱子移到另一根柱子也是小菜一碟。你能移动最小的三个圆盘吗?",
|
||||
|
Reference in New Issue
Block a user