House Robber teaches a core DP pattern: When can't take adjacent elements, your transition considers two choices: skip the current element, or take it plus the best answer from two positions back.
The recurrence captures this exactly. Skip house and keep , or rob house and add to .
This pattern appears in many problems: picking non-adjacent elements, scheduling with cooldowns, or any situation where taking one option blocks the next. the space reduction: you only need the last two values. This reduces space to . Watch for this pattern in other DP problems.