MCPcopy 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

1class 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

helperMethod · 0.95
maxFunction · 0.50

Tested by

no test coverage detected