Search
⌘K

Leetcode 3140. Consecutive Available Seats II

Given a dynamic row of seats with operations that occupy or free individual seats, implement a query that finds and optionally reserves k consecutive available seats (or reports failure). The core challenge is to maintain and query maximal free segments efficiently under many updates, typically solved with interval/segment-tree or ordered-set techniques.

Asked at:

Google

Google


Question Timeline

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

Early September, 2024

Google

Google

Mid-level

Find periods where P people are available for at least X consecutive days

Comments

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