Merge pull request #2347 from jycoast/master

修复337.打家劫舍 III 注释错别字“又孩子”为“右孩子”
This commit is contained in:
程序员Carl
2023-11-30 09:55:16 +08:00
committed by GitHub

View File

@ -266,7 +266,7 @@ class Solution {
// 3.状态标记递归
// 执行用时0 ms , 在所有 Java 提交中击败了 100% 的用户
// 不偷Max(左孩子不偷,左孩子偷) + Max(孩子不偷,右孩子偷)
// 不偷Max(左孩子不偷,左孩子偷) + Max(孩子不偷,右孩子偷)
// root[0] = Math.max(rob(root.left)[0], rob(root.left)[1]) +
// Math.max(rob(root.right)[0], rob(root.right)[1])
// 偷:左孩子不偷+ 右孩子不偷 + 当前节点偷