Subtree with Maximum Average
Last updated
Was this helpful?
Last updated
Was this helpful?
Given an N-ary tree, find the subtree with the maximum average. Return the root of the subtree. A subtree of a tree is the node which have at least 1 child plus all its descendants. The average value of a subtree is the sum of its values, divided by the number of nodes.
Example 1:
Similar questions: