168. House Robber II

MediumDynamic Programming

Houses are arranged in a circle. Adjacent houses cannot both be robbed. Return the maximum amount of money you can rob.

Examples

Input: [200,3,140,20,10]

Output: 340

Explanation: Public test case for House Robber II

Constraints

  • 1 <= nums.length <= 100
  • 0 <= nums[i] <= 1000
Loading...

Run checks all cases above. Submit evaluates all test cases.