Algorithm · Square · Medium
A ticketing venue represents its seating layout as a two-dimensional grid. Every cell in the grid is a seat in one of three states: empty, occupied, or blocked. Implement the following pieces of functionality: Locate a run of N empty seats that sit next to each other within a single row. Assign seats (marking them occupied) and release seats (returning them to empty). Process a sequence of reservation and cancellation operations against the grid, and once every operation has…