House Robber — work backwards with a DP table
Let dp[i] be the most you can rob from house i onward. At each house you either rob it and skip the next (dp[i+2]) or skip it (dp[i+1]). Fill from the last house back to the first.
Try:
← Prev
Next →
▶ Play
Reset
houses (money)
dp (best from house i onward)