Skip to content

Commit 67d0f73

Browse files
committed
[Week1] House Robber 수정.
1 parent 4247144 commit 67d0f73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

house-robber/gmlwls96.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ class Solution {
1111
if (index >= nums.size) {
1212
return 0
1313
}
14-
return nums[index] + rob_recursion(nums, index + 2)
14+
return nums[index] + Integer.max(rob_recursion(nums, index + 2), rob_recursion(nums, index + 3))
1515
}
1616
}

0 commit comments

Comments
 (0)