Merge pull request #1335 from heiyu4585/master

修改:0404左叶子之和javascript版本调用方法
This commit is contained in:
程序员Carl
2022-06-05 09:32:40 +08:00
committed by GitHub

View File

@ -336,8 +336,8 @@ var sumOfLeftLeaves = function(root) {
if(node===null){
return 0;
}
let leftValue = sumOfLeftLeaves(node.left);
let rightValue = sumOfLeftLeaves(node.right);
let leftValue = nodesSum(node.left);
let rightValue = nodesSum(node.right);
// 3. 单层递归逻辑
let midValue = 0;
if(node.left&&node.left.left===null&&node.left.right===null){