Given a circular street of houses, return the maximum amount you can rob without robbing adjacent houses. Pattern focus: Take Or Skip DP. Because the first and last houses are adjacent, solve two linear cases and take the maximum.
nums = money in circular houses
maximum amount that can be robbed
Example 1:
Input:
nums = [2,3,2]
Output:
3
Explanation:
You cannot rob both the first and last houses.
Example 2:
Input:
nums = [1,2,3,1]
Output:
4
Explanation:
The best result comes from robbing the middle houses.