python:
class Solution: def rob(self, nums): """ :type nums: List[int] :rtype: int """ one,two = 0, 0 for i in nums: one, two = two, max(one+i, two) return two
python:
class Solution: def rob(self, nums): """ :type nums: List[int] :rtype: int """ one,two = 0, 0 for i in nums: one, two = two, max(one+i, two) return two