We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ca6279 commit ad3dfffCopy full SHA for ad3dfff
website/content/ChapterFour/0100~0199/0129.Sum-Root-to-Leaf-Numbers.md
@@ -45,7 +45,7 @@ Find the total sum of all root-to-leaf numbers.
45
46
## 解题思路
47
48
-- 这一题是第 257 题的变形题,第 257 题要求输出每条从根节点到叶子节点的路径,这一题变成了把每一个从根节点到叶子节点的数字都串联起来,再累加每条路径,求出最后的总和。实际做题思路基本没变
+- 这一题是第 257 题的变形题,第 257 题要求输出每条从根节点到叶子节点的路径,这一题变成了把每一个从根节点到叶子节点的数字都串联起来,再累加每条路径,求出最后的总和。实际做题思路基本没变。运用前序遍历的思想,当从根节点出发一直加到叶子节点,每个叶子节点汇总一次。
49
50
51
## 代码
0 commit comments