cs.thefarshad
medium Dynamic Programming

House Robber

Each `nums[i]` is the money in house i. You cannot rob two adjacent houses. Return the maximum you can rob. Example: [2, 7, 9, 3, 1] → 12 (rob houses 0, 2, 4).

runs in your browser