We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2998feb commit 3bcc3a6Copy full SHA for 3bcc3a6
java/house-robber.md
@@ -52,7 +52,7 @@ To optimize the recursive approach, we can use memoization to store the results
52
```java
53
class Solution {
54
public int rob(int[] nums) {
55
- int[] memo = new int[nums.length + 1];
+ int[] memo = new int[nums.length];
56
Arrays.fill(memo, -1);
57
return robFrom(0, nums, memo);
58
}
0 commit comments