House Robber II

You are given a row of houses arranged in a circle. Each house contains some amount of money.

You want to collect as much money as possible, but there is one rule:

  • you cannot rob two houses that are next to each other
  • because the houses are in a circle, the first house and the last house are also next to each other

Return the largest amount of money you can rob without robbing any adjacent houses.

Examples
Input: [2,3,2]
Output: 3
Hints
Related Problems

House Robber II

You are given a row of houses arranged in a circle. Each house contains some amount of money.