Fetching data...
This may take a moment
Back
2126. Count Nodes Equal to Sum of Descendants
Medium
Tree
Depth-First Search
Binary Tree
Solve on LeetCode
View Solutions
Description
Hints
Hint 1
Can we reuse previously calculated information?
Hint 2
How can we calculate the sum of the current subtree using the sum of the child's subtree?
Similar Questions
Most Frequent Subtree Sum
Medium
Maximum Average Subtree
Medium
Count Nodes Equal to Average of Subtree
Medium
Statistics
Acceptance
77.3%
Submissions
20,269
Accepted
15,667