Delete Zero Sum Sub-Trees
Given a binary tree, delete any sub-trees whose nodes sum up to zero.
We'll cover the following
Statement
Given the root of a binary tree, delete any sub-trees whose nodes sum up to zero.
Example
In the binary tree below, we need to delete the sub-tree starting at node as its sum ( − − ) equals zero.
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.