Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2286. Booking Concert Tickets in Groups
Support two booking operations on n rows with m seats each: gather(k,maxRow) must find the smallest row ≤ maxRow with k consecutive free seats and return the starting seat, while scatter(k,maxRow) must determine (and if possible allocate) k seats across rows 0..maxRow using the smallest row and seat numbers. The challenge is to maintain per-row free-seat information and support efficient range-max and prefix-sum queries/updates to locate contiguous blocks and verify/perform greedy allocations.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.