Given an array nums where nums[i] is money in the ith house, return the maximum amount you can rob without robbing adjacent houses. Pattern focus: Take Or Skip DP. At each index, decide whether to take the current house or skip it.
nums = money in each house
maximum amount that can be robbed
Example 1:
Input:
nums = [1,2,3,1]
Output:
4
Explanation:
Rob houses 1 and 3.
Example 2:
Input:
nums = [2,7,9,3,1]
Output:
12
Explanation:
Rob houses 1, 3, and 5.