Available question text
Given a rooted tree (via a parent array) and values for each node, remove all subtrees whose total node-sum equals zero (deletions cascade) and return the count of remaining nodes; the core challenge is computing subtree sums with a postorder DFS and pruning based on those sums.
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
- Binary Tree Nodes
Coding
- Closest Nodes Queries in a Binary Search Tree
Coding
- Count Complete Tree Nodes
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 1273. Delete Tree Nodes
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source