Skip to content

feat(coding-challenges): dynamic programming - house robber with two rolling states - #98

Merged
Irish-Joseph merged 1 commit into
mainfrom
feat/2026-09-25-17-coding-house-robber
Sep 25, 2026
Merged

Irish-Joseph merged 1 commit into
mainfrom
feat/2026-09-25-17-coding-house-robber

Conversation

@Irish-Joseph

Copy link
Copy Markdown
Owner

Adds coding-challenges/dynamic-programming/house_robber.py (Medium) — the take/skip two-state DP collapsed to two rolling variables (O(1) space), including why the O(n) table is unnecessary. Tests cover empty, single, two houses, all-equal, and the [2,1,4,1,1] case where "take the biggest first" gets 6 instead of 7, plus 300 randomised cross-checks against an exhaustive subset search.

Validation: python coding-challenges/dynamic-programming/house_robber.py passed; full suite python scripts/run_challenges.py → 53/53.

…rolling states

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Irish-Joseph
Irish-Joseph merged commit edd8611 into main Sep 25, 2026
1 check passed
@Irish-Joseph
Irish-Joseph deleted the feat/2026-09-25-17-coding-house-robber branch September 25, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant