1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 19:31:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part6

This commit is contained in:
2022-03-27 20:56:26 +08:00
parent c11d601602
commit 08d1f2a596
1096 changed files with 88216 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
<p>给你一个二叉树的根节点 <code>root</code> ,按 <strong>任意顺序</strong> ,返回所有从根节点到叶子节点的路径。</p>
<p><strong>叶子节点</strong> 是指没有子节点的节点。</p>
&nbsp;
<p><strong>示例 1</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/03/12/paths-tree.jpg" style="width: 207px; height: 293px;" />
<pre>
<strong>输入:</strong>root = [1,2,3,null,5]
<strong>输出:</strong>["1-&gt;2-&gt;5","1-&gt;3"]
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>root = [1]
<strong>输出:</strong>["1"]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点的数目在范围 <code>[1, 100]</code></li>
<li><code>-100 &lt;= Node.val &lt;= 100</code></li>
</ul>