@@ -0,0 +1,512 @@
+package leetcode.path_sum;%0A%0Aimport common.TreeNode;%0A%0Apublic class Solution %7B%0A%09public boolean hasPathSum(TreeNode root, int sum) %7B%0A%09%09if(root == null) return false;%0A%09%09if(root.left != null)%7B%0A%09%09%09if(root.right == null)%7B%0A%09%09%09%09return hasPathSum(root.left, sum - root.val);%0A%09%09%09%7Delse%7B%0A%09%09%09%09return hasPathSum(root.left, sum - root.val) %7C%7C hasPathSum(root.right, sum - root.val);%0A%09%09%09%7D%0A%09%09%7Delse%7B%0A%09%09%09if(root.right == null)%7B%0A%09%09%09%09return sum == root.val;%0A%09%09%09%7Delse%7B%0A%09%09%09%09return hasPathSum(root.right, sum - root.val);%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Add java solution for 112. Path Sum