1class Solution {2 public:3 TreeNode *pruneTree(TreeNode *root) {4 if (!root) return NULL;5 root->left = pruneTree(root->left);6 root->right = pruneTree(root->right);7 if (!root->left && !root->right && root->val == 0) return NULL;8 return root;9 }10};
WPM •0 •0
ACC •0 •0
TIME •0