mirror of
https://github.com/labuladong/fucking-algorithm.git
synced 2025-07-05 03:36:39 +08:00
增加注释
This commit is contained in:
@ -311,7 +311,9 @@ class Solution:
|
||||
left = dp(root.left)
|
||||
right = dp(root.right)
|
||||
|
||||
# 抢当前,则两个下家不抢
|
||||
do = root.val + left[0] + right[0]
|
||||
# 不抢当前,则下家随意
|
||||
do_not = max(left) + max(right)
|
||||
|
||||
return do_not, do
|
||||
|
Reference in New Issue
Block a user