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 4247144 commit 67d0f73Copy full SHA for 67d0f73
house-robber/gmlwls96.kt
@@ -11,6 +11,6 @@ class Solution {
11
if (index >= nums.size) {
12
return 0
13
}
14
- return nums[index] + rob_recursion(nums, index + 2)
+ return nums[index] + Integer.max(rob_recursion(nums, index + 2), rob_recursion(nums, index + 3))
15
16
0 commit comments