public List<List<Integer>> pathSum(TreeNode root, int sum) { if (root == null) return res; findPath(root, sum, new ArrayList<>()); return res; }
private List<List<Integer>> res = new ArrayList<>(); publicvoidfindPath(TreeNode root, int remain, List<Integer> path){ //结束条件 if (root == null) return ;