Skip to content

Bug Report for house-robber #4301

Open
Open
@sidhantsinghvi

Description

@sidhantsinghvi

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions