题目:

解析:

代码:
public TreeNode pruneTree(TreeNode root) {
if(root == null) return root;
root.left = pruneTree(root.left);
root.right = pruneTree(root.right);
if(root.left == null && root.right == null && root.val == 0)
root = null;
return root;
}