Loading problem…
This problem builds on house-robber. Complete that first, then load your solution to continue.
Houses stand around a circular street. The integer array nums gives the money in each house, in street order.
Choose houses to maximize the total money collected without choosing two adjacent houses. The first and last houses are adjacent because the street is circular. Return the maximum total; do not return the selected indices.
You may choose no houses. If there is only one house, you may choose it. For two houses, choose at most one.
Example 1:
Example 2:
Example 3: