198. House Robber - LeetCode
class Solution:
def rob(self, nums: list[int]) -> int:
a, b = 0, 0
for n in nums:
a, b = b, max(a + n, b)
return b
class Solution:
def rob(self, nums: list[int]) -> int:
a, b = 0, 0
for n in nums:
a, b = b, max(a + n, b)
return b