Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add C++ Solutions for House Robber (LeetCode 198) [Recursion + Memoization, Tabulation, Space Optimized] #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
singhsayan wants to merge 1 commit into codedecks-in:master
base: master
Choose a base branch
Loading
from singhsayan:house-robber-solution

Conversation

Copy link

@singhsayan singhsayan commented Aug 28, 2025

Problem: House Robber (LeetCode Problem 198)
Issue Linked: Closes #514

Contribution:
Added C++ solutions under C++/HouseRobber.cpp.
Implemented three approaches:
1. Recursion + Memoization — O(n) time, O(n) space
2. Tabulation (Bottom-Up DP) — O(n) time, O(n) space
3. Space Optimized DP (Final Solution) — O(n) time, O(1) space
• Included clear comments and structured code for readability.
• Added example test case for validation.

Example:
Input: [2,7,9,3,1]
Output: 12

...cursion+memoization, tabulation, and space-optimized DP
Copy link

welcome bot commented Aug 28, 2025

I can tell this is your first pull request! Thank you I'm so honored. 🎉🎉🎉 I'll take a look at it ASAP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Issue Proposal: House Robber (LeetCode Problem 198)
1 participant

AltStyle によって変換されたページ (->オリジナル) /