Skip to content

Commit

Permalink
增加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
ningwei.shi committed Nov 12, 2020
1 parent cfdfa28 commit 8a2f374
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 动态规划系列/抢房子.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8a2f374

Please sign in to comment.