@@ -0,0 +1,957 @@
+public class Solution %7B%0A    public List%3CList%3CInteger%3E%3E pathSum(TreeNode root, int sum) %7B%0A        List%3CList%3CInteger%3E%3E validPaths = new ArrayList%3CList%3CInteger%3E%3E ();%0A        List%3CInteger%3E curPath = new ArrayList%3CInteger%3E ();%0A        %0A        pathSumRecur(root, sum, validPaths, curPath);%0A        %0A        return validPaths;%0A    %7D%0A    %0A    private void pathSumRecur(TreeNode root, int sum, List%3CList%3CInteger%3E%3E validPaths, List%3CInteger%3E curPath) %7B%0A        if (root == null) %7B%0A            return;%0A        %7D%0A        %0A        curPath.add(root.val);%0A        if (root.left == null && root.right == null && sum == root.val) %7B%0A            validPaths.add(new ArrayList%3CInteger%3E(curPath));  //make sure saving a copy, since the list will be changed%0A        %7D else %7B%0A            pathSumRecur(root.left, sum-root.val, validPaths, curPath);%0A            pathSumRecur(root.right, sum-root.val, validPaths, curPath);%0A        %7D%0A        curPath.remove(curPath.size()-1);%0A    %7D%0A%7D%0A

Create Path_Sum_II.java