Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Consecutive Free Seats

A cinema row has seats numbered from 1 where free = 1 means the seat is available. Return the seat_ids of all free seats that belong to a run of at least two consecutive free seats, ordered by seat_id.

Table schema

Cinema(seat_id INT PRIMARY KEY, free INT)

Sample data

seat_id | free
1 | 1
2 | 0
3 | 1
4 | 1
5 | 1

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.