public static ArrayList<ArrayList<Integer>> FindPath(TreeNode root, int target) {
    ArrayList<ArrayList<Integer>> res = new ArrayList<>();  ArrayList<Integer> t_res = new ArrayList<>();  helper(root, res, t_res,0, target);  return res; } private static void helper(TreeNode root, ArrayList<ArrayList<Integer>> res, ArrayList<Integer> t_res,int sum, int target) { if(root==null) return;  if(root.left==null&&root.right==null){//叶子节点  if(sum+root.val==target){//正好  t_res.add(root.val);  res.add(new ArrayList<>(t_res));  //回溯上一个节点  if(!t_res.isEmpty()){
                t_res.remove(t_res.size() - 1);  }
        } else { return;  }
    } else { if(sum+root.val>target){ return;  } else {
            sum += root.val;  t_res.add(root.val);  if(root.left!=null){helper(root.left,res,t_res,sum,target);} if(root.right!=null){helper(root.right,res,t_res,sum,target);}
            t_res.remove(t_res.size() - 1);  }
    }
}