@@ -0,0 +1,956 @@
+package me.wayne.leetcodetop100.binarytree;%0A%0Aimport me.wayne.leetcodetop100.TreeNode;%0A%0A/**%0A * %E7%BB%99%E4%BD%A0%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E6%A0%B9%E8%8A%82%E7%82%B9root%E5%92%8C%E4%B8%80%E4%B8%AA%E8%A1%A8%E7%A4%BA%E7%9B%AE%E6%A0%87%E5%92%8C%E7%9A%84%E6%95%B4%E6%95%B0targetSum %E3%80%82%0A * %E5%88%A4%E6%96%AD%E8%AF%A5%E6%A0%91%E4%B8%AD%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8 %E6%A0%B9%E8%8A%82%E7%82%B9%E5%88%B0%E5%8F%B6%E5%AD%90%E8%8A%82%E7%82%B9 %E7%9A%84%E8%B7%AF%E5%BE%84%EF%BC%8C%E8%BF%99%E6%9D%A1%E8%B7%AF%E5%BE%84%E4%B8%8A%E6%89%80%E6%9C%89%E8%8A%82%E7%82%B9%E5%80%BC%E7%9B%B8%E5%8A%A0%E7%AD%89%E4%BA%8E%E7%9B%AE%E6%A0%87%E5%92%8CtargetSum%E3%80%82%0A * %E5%A6%82%E6%9E%9C%E5%AD%98%E5%9C%A8%EF%BC%8C%E8%BF%94%E5%9B%9E true %EF%BC%9B%E5%90%A6%E5%88%99%EF%BC%8C%E8%BF%94%E5%9B%9E false %E3%80%82%0A * %3Cp%3E%0A * %E9%93%BE%E6%8E%A5%EF%BC%9Ahttps://leetcode-cn.com/problems/path-sum%0A */%0Apublic class LC112_HasPathSum %7B%0A%0A    public boolean hasPathSum(TreeNode root, int targetSum) %7B%0A        if (root == null) %7B%0A            return false;%0A        %7D else if (root.val == targetSum && root.left == null && root.right == null) %7B%0A            return true;%0A        %7D else %7B%0A            boolean leftHasPath = false;%0A            if (root.left != null) %7B%0A                leftHasPath = hasPathSum(root.left, targetSum - root.val);%0A            %7D%0A            boolean rightHasPath = false;%0A            if (root.right != null) %7B%0A                rightHasPath = hasPathSum(root.right, targetSum - root.val);%0A            %7D%0A            return leftHasPath %7C%7C rightHasPath;%0A        %7D%0A    %7D%0A%7D%0A

add LC112_HasPathSum