mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-25 14:58:56 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>在一个 m*n 的二维字符串数组中输出二叉树,并遵守以下规则:</p>\n\n<ol>\n\t<li>行数 <code>m</code> 应当等于给定二叉树的高度。</li>\n\t<li>列数 <code>n</code> 应当总是奇数。</li>\n\t<li>根节点的值(以字符串格式给出)应当放在可放置的第一行正中间。根节点所在的行与列会将剩余空间划分为两部分(<strong>左下部分和右下部分</strong>)。你应该将左子树输出在左下部分,右子树输出在右下部分。左下和右下部分应当有相同的大小。即使一个子树为空而另一个非空,你不需要为空的子树输出任何东西,但仍需要为另一个子树留出足够的空间。然而,如果两个子树都为空则不需要为它们留出任何空间。</li>\n\t<li>每个未使用的空间应包含一个空的字符串<code>""</code>。</li>\n\t<li>使用相同的规则输出子树。</li>\n</ol>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>\n 1\n /\n 2\n<strong>输出:</strong>\n[["", "1", ""],\n ["2", "", ""]]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>\n 1\n / \\\n 2 3\n \\\n 4\n<strong>输出:</strong>\n[["", "", "", "1", "", "", ""],\n ["", "2", "", "", "", "3", ""],\n ["", "", "4", "", "", "", ""]]\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>\n 1\n / \\\n 2 5\n / \n 3 \n / \n4 \n<strong>输出:</strong>\n[["", "", "", "", "", "", "", "1", "", "", "", "", "", "", ""]\n ["", "", "", "2", "", "", "", "", "", "", "", "5", "", "", ""]\n ["", "3", "", "", "", "", "", "", "", "", "", "", "", "", ""]\n ["4", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]]\n</pre>\n\n<p><strong>注意:</strong> 二叉树的高度在范围 [1, 10] 中。</p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 117,
|
||||
"likes": 122,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"11K\", \"totalSubmission\": \"18.3K\", \"totalAcceptedRaw\": 11039, \"totalSubmissionRaw\": 18308, \"acRate\": \"60.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"11.3K\", \"totalSubmission\": \"18.8K\", \"totalAcceptedRaw\": 11300, \"totalSubmissionRaw\": 18757, \"acRate\": \"60.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
||||
Reference in New Issue
Block a user