Search
⌘K

Leetcode 2728. Count Houses in a Circular Street

Given a circular street represented by an array of houses, count how many houses satisfy a local property that depends on their neighbors (e.g., empty/available, isolated, or collectible). The core challenge is correctly handling circular adjacency (wrap-around) and evaluating the local predicate for each house, typically achievable in a single O(n) pass.

Asked at:

Apple


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid September, 2024

Apple

Senior

Stickler thief in a circular array (with modifications: toys and fun units instead of houses and money)

Comments

Your account is free and you can post anonymously if you choose.