mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 14:12:17 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一棵二叉树,它的根为 <code>root</code> 。请你删除 1 条边,使二叉树分裂成两棵子树,且它们子树和的乘积尽可能大。</p>\n\n<p>由于答案可能会很大,请你将结果对 10^9 + 7 取模后再返回。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><strong><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/02/02/sample_1_1699.png\" style=\"height: 200px; width: 495px;\"></strong></p>\n\n<pre><strong>输入:</strong>root = [1,2,3,4,5,6]\n<strong>输出:</strong>110\n<strong>解释:</strong>删除红色的边,得到 2 棵子树,和分别为 11 和 10 。它们的乘积是 110 (11*10)\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/02/02/sample_2_1699.png\" style=\"height: 200px; width: 495px;\"></p>\n\n<pre><strong>输入:</strong>root = [1,null,2,3,4,null,null,5,6]\n<strong>输出:</strong>90\n<strong>解释:</strong>移除红色的边,得到 2 棵子树,和分别是 15 和 6 。它们的乘积为 90 (15*6)\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>root = [2,3,9,10,7,8,6,5,4,11,1]\n<strong>输出:</strong>1025\n</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre><strong>输入:</strong>root = [1,1]\n<strong>输出:</strong>1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>每棵树最多有 <code>50000</code> 个节点,且至少有 <code>2</code> 个节点。</li>\n\t<li>每个节点的值在 <code>[1, 10000]</code> 之间。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 71,
|
||||
"likes": 72,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9.6K\", \"totalSubmission\": \"23.8K\", \"totalAcceptedRaw\": 9624, \"totalSubmissionRaw\": 23804, \"acRate\": \"40.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"9.9K\", \"totalSubmission\": \"24.4K\", \"totalAcceptedRaw\": 9889, \"totalSubmissionRaw\": 24380, \"acRate\": \"40.6%\"}",
|
||||
"hints": [
|
||||
"If we know the sum of a subtree, the answer is max( (total_sum - subtree_sum) * subtree_sum) in each node."
|
||||
],
|
||||
|
Reference in New Issue
Block a user