213. House Robber II

#dp

Problem

Intuition

The inution of the problem is same as 198. House Robber.

Except here it is a extra constraint that it is circular. Which means, we cannot consider the first and last house at same time. So to avoid that, we make the array into two different subarrays

  1. O to last but 1 [0 to n-1]

  2. 1 to last [1 to n]

Time Complexity

Space Complexity

Solution

Last updated