House robber
easyRob house i and you must have skipped i−1, so you add to dp[i−2]. The adjacency constraint lives entirely in that index gap - and only two previous values are ever read.
Worst
O(n)Space O(1) after the rolling-variable optimisationLoading the house robber engine…