Optimal Algorithmic Approach
1D DP reduced to two variables.
Core Invariants & Edge Cases
- dp[i] = max(dp[i-1], dp[i-2] + nums[i])
- Only need to track prev2 and prev1 (O(1) space)
- House Robber II: handle circular array by running twice (exclude first or last)