Leetcode112:路径总和

public boolean hasPathSum(TreeNode root, int sum) { if (root == null) { return false; } if (root.left == null && root.right == null) { return root.val==sum; } return hasPathSum(root.l
相关文章
相关标签/搜索