Consecutive Free Seats
Easy
Gaps and Islands
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.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.