Open
Description
Bug Report for https://neetcode.io/problems/house-robber
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
class Solution {
public:
int rob(vector& nums) {
for(int i=nums.size()-3;i>=0;i--){
nums[i]=max(nums[i]+nums[i+2],nums[i+1]);
}
return max(nums[0],nums[1]);
}
};
passes all tests but shouldnt. need better test cases like [9,8,3,6]
Metadata
Metadata
Assignees
Labels
No labels