InterviewDB
Question
Terminal Nodes: Count and Return All Leaf Nodes Satisfying a Value Condition
phone
Question Details
Problem Given the root of a binary tree, return all terminal (leaf) nodes whose value satisfies a given predicate. Additionally, after collecting them, prune the tree so that no remaining leaf node fails the predicate ā repeat pruning until stable. Eā¦
Full Details
🔒
Unlock full leaked content
Full insider details, leaked discussions, and candidate experiences.
Get Premium →Topics
Coding
Onsite
Phone