NeetCode #403LC-1120MediumTreesNC Algo100
← Back to All Problems

#403 · #1120 · Maximum Average Subtree(子树的最大平均值)

📌 Problem Statement & Constraints

Given the root of a binary tree, return the maximum average value of any subtree. A subtree is a node plus all its descendants, and its average is the sum of its values divided by its node count. Constraints: the number of nodes is in [1, 5000], 0 <= Node.val <= 10^5.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!