Skip to content

Commit 32faa77

Browse files
authored
Merge pull request AlgoMaster-io#7 from Abhishek-Khelge/patch-1
Update house-robber.md
2 parents 2998feb + 3bcc3a6 commit 32faa77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/house-robber.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ To optimize the recursive approach, we can use memoization to store the results
5252
```java
5353
class Solution {
5454
public int rob(int[] nums) {
55-
int[] memo = new int[nums.length + 1];
55+
int[] memo = new int[nums.length];
5656
Arrays.fill(memo, -1);
5757
return robFrom(0, nums, memo);
5858
}

0 commit comments

Comments
 (0)