var sumOfLeftLeaves = function(root) {
if(root==null) return 0;
return sumOfLeftLeaves(root.left)+ sumOfLeftLeaves(root.right)+ (root.left!=null && root.left.right==null&&root.left.left==null ? root.left.val : 0);
};
找到左叶子节点:没有left和right,递归查找
var sumOfLeftLeaves = function(root) {
if(root==null) return 0;
return sumOfLeftLeaves(root.left)+ sumOfLeftLeaves(root.right)+ (root.left!=null && root.left.right==null&&root.left.left==null ? root.left.val : 0);
};
找到左叶子节点:没有left和right,递归查找