【LeetCode】Python實現-198. 打家劫舍

解答: class Solution(object): def rob(self, nums): """ :type nums: List[int] :rtype: int """ last = 0 now = 0 for i in nums: last, now = now, max(last +
相關文章
相關標籤/搜索