LC: 1120. Maximum Average Subtree
https://leetcode.com/problems/maximum-average-subtree/
Input: root = [5,6,1]
Output: 6.00000
Explanation:
For the node with value = 5 we have an average of (5 + 6 + 1) / 3 = 4.
For the node with value = 6 we have an average of 6 / 1 = 6.
For the node with value = 1 we have an average of 1 / 1 = 1.
So the answer is 6 which is the maximum.Input: root = [0,null,1]
Output: 1.00000PreviousLC: 1101. The Earliest Moment When Everyone Become FriendsNextLC: 1133. Largest Unique Number
Last updated
