0814. Binary Tree Pruning
Last updated
Last updated
**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]**Input:** root = [1,1,0,1,1,0,1,0]
**Output:** [1,1,0,1,1,null,1]