We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e99748 commit c0ae760Copy full SHA for c0ae760
house_robber.py
@@ -15,7 +15,7 @@ def houseRobber(self, A):
15
if len(A) == 1:
16
return A[0]
17
if len(A) == 2:
18
- return min(A[0], A[1])
+ return max(A[0], A[1])
19
for i in xrange(2, len(A)):
20
A[i] = max(A[i] + A[i - 2], A[i - 1])
21
return A[-1]
0 commit comments