[Swift]LeetCode1302. 层数最深叶子节点的和 | Deepest Leaves Sum

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
➤微信公众号:山青咏芝(let_us_code)
➤博主域名:https://www.zengqiang.org
➤GitHub地址:https://github.com/strengthen/LeetCode
➤原文地址:https://www.cnblogs.com/strengthen/p/12151658.html
➤如果链接不是山青咏芝的博客园地址,则可能是爬取作者的文章。
➤原文已修改更新!强烈建议点击原文地址阅读!支持作者!支持原创!
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

Given a binary tree, return the sum of values of its deepest leaves.
 

Example 1:

 

Input: root = [1,2,3,4,5,null,6,7,null,null,null,null,8]
Output: 15
 

Constraints:

The number of nodes in the tree is between 1 and 10^4.
The value of nodes is between 1 and 100.


给你一棵二叉树,请你返回层数最深的叶子节点的和。

示例:

输入:root = [1,2,3,4,5,null,6,7,null,null,null,null,8]
输出:15
 

提示:

树中节点数目在 1 到 10^4 之间。
每个节点的值在 1 到 100 之间。

原文地址:https://www.cnblogs.com/strengthen/p/12151658.html