House Robber is the cleanest choose-with-a-constraint 1D DP, and it collapses to O(1) space. The signal is the take-this-or-skip recurrence and the two-variable rolling optimization.
Unlock the other 750 answers · ₹2,000 / $25Your progress and mastery stay saved · 6 months · one payment · no auto-renew
