Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/neetcode-gh/leetcode
/ rob
Method
rob
python/0213-house-robber-ii.py:2–3 ·
view source on GitHub ↗
(self, nums: List[int])
Source
from the content-addressed store, hash-verified
1
class
Solution:
2
def
rob(self, nums: List[int]) -> int:
3
return
max(nums[0], self.helper(nums[1:]), self.helper(nums[:-1]))
4
5
def
helper(self, nums):
6
rob1, rob2 = 0, 0
Callers
nothing calls this directly
Calls
2
helper
Method · 0.95
max
Function · 0.50
Tested by
no test coverage detected