Available question text
Given a binary tree with node values 0 or 1, remove every subtree that does not contain a 1 and return the pruned tree. This requires a post-order traversal to determine for each node whether its left/right subtrees contain any 1s and should be kept.
Related questions
Continue with questions that share topics or the same question type.
- All Nodes Distance K in Binary Tree
Coding · Binary Tree · Breadth-First Search · Depth-First Search
- Amount of Time for Binary Tree to Be Infected
Coding · Binary Tree · Breadth-First Search · Depth-First Search
- Average of Levels in Binary Tree
Coding
- Balance a Binary Search Tree
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 814. Binary Tree Pruning
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source