@@ -0,0 +1,555 @@
+public class LeetCode0112 %7B%0A%0A%09public class TreeNode %7B%0A%09%09int val;%0A%09%09TreeNode left;%0A%09%09TreeNode right;%0A%0A%09%09TreeNode(int x) %7B%0A%09%09%09val = x;%0A%09%09%7D%0A%09%7D%0A%0A%09public boolean hasPathSum(TreeNode root, int sum) %7B%0A%09%09return dfs(root, 0, sum);%0A%09%7D%0A%0A%09private boolean dfs(TreeNode root, int current, int sum) %7B%0A%09%09if (root == null) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09if (root.left == null && root.right == null) %7B%0A%09%09%09if (current + root.val == sum) %7B%0A%09%09%09%09return true;%0A%09%09%09%7D%0A%09%09%09return false;%0A%09%09%7D%0A%09%09return dfs(root.left, current + root.val, sum) %7C%7C dfs(root.right, current + root.val, sum);%0A%09%7D%0A%7D

Add LeetCode0122.java