596.Minimum Subtree
1.Description(Easy)
Given a binary tree, find the subtree with minimum sum. Return the root of the subtree.
Example
Given a binary tree:
return the node1
.
2.Code
与597 Subtree with maximum average 相似,
两个类变量 TreeNode 记录当前变量,minsum记录变化的最小值
Last updated