// House Robber — MEDIUM
// Category: dynamic-programming
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money. You cannot rob two adjacent houses (the alarm will trigger).
Given an integer array `nums` representing each house's money, return the maximum amount you can rob.
Hint: DP — at each house you either rob it (plus best from 2 before) or skip it (best from previous house). `dp[i] = max(dp[i-1], dp[i-2] + nums[i])`.
Example: nums = [1, 2, 3, 1]
Output: 4