814. Binary Tree Pruning
Medium
Input: root = [1,null,0,0,1]
Output:
[1,null,0,null,1]
Explanation:
Only the red nodes satisfy the property "every subtree not containing a 1".
The diagram on the right represents the answer.Input: root = [1,0,1,0,0,0,1]
Output:
[1,null,1,null,1]Last updated


