Given the root of a binary tree, return the number of nodes where the value of the node is equal to the average of the values in its subtree.
Note: The average of
elements is the sum of the elements divided by , rounded down to the nearest integer. A subtree of a node includes the node itself along with all of its descendants.
Constraints:
The number of nodes in the tree is in the range
Node.val
Given the root of a binary tree, return the number of nodes where the value of the node is equal to the average of the values in its subtree.
Note: The average of
elements is the sum of the elements divided by , rounded down to the nearest integer. A subtree of a node includes the node itself along with all of its descendants.
Constraints:
The number of nodes in the tree is in the range
Node.val