Coding Challenge

House Robber II

Medium
dynamic-programming

House Robber with houses arranged in a circle.

The first and last houses are adjacent because the houses form a circle. Return the maximum amount you can rob.

Examples

Input: nums = [2,3,2]

Output: 3

Constraints

  • 1 <= nums.length

Preparing your coding workspace...