1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/层数最深叶子节点的和 [deepest-leaves-sum].html

29 lines
801 B
HTML
Raw Permalink Normal View History

2022-03-27 20:37:52 +08:00
<p>给你一棵二叉树的根节点 <code>root</code> ,请你返回 <strong>层数最深的叶子节点的和</strong></p>
<p> </p>
<p><strong>示例 1</strong></p>
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/12/28/1483_ex1.png" style="height: 265px; width: 273px;" /></strong></p>
<pre>
<strong>输入:</strong>root = [1,2,3,4,5,null,6,7,null,null,null,null,8]
<strong>输出:</strong>15
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>root = [6,7,8,2,7,1,3,9,null,1,4,null,null,null,5]
<strong>输出:</strong>19
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点数目在范围 <code>[1, 10<sup>4</sup>]</code> 之间。</li>
<li><code>1 <= Node.val <= 100</code></li>
</ul>