Loading problem...
You are given a Cinema table with one row per seat.
Columns:
Task: Return every seat_id that belongs to at least one adjacent free pair.
A seat should be included only when:
Return exactly one column named seat_id, sorted in ascending order.
Supported submission environments:
Cinema:
| seat_id | free |
|---------|------|
| 1 | 1 |
| 2 | 0 |
| 3 | 1 |
| 4 | 1 |
| 5 | 1 |[
{"seat_id": 3},
{"seat_id": 4},
{"seat_id": 5}
]Seats 3, 4, and 5 are all free and each has at least one free adjacent neighbor.
Cinema:
| seat_id | free |
|---------|------|
| 20 | 1 |
| 21 | 1 |
| 22 | 0 |
| 23 | 1 |
| 24 | 1 |
| 30 | 1 |
| 31 | 0 |[
{"seat_id": 20},
{"seat_id": 21},
{"seat_id": 23},
{"seat_id": 24}
]There are two valid free pairs: (20,21) and (23,24). Seat 30 is free but isolated from another free neighbor.
Cinema:
| seat_id | free |
|---------|------|
| 10 | 1 |
| 11 | 1 |
| 14 | 1 |
| 16 | 1 |
| 17 | 1 |
| 19 | 0 |[
{"seat_id": 10},
{"seat_id": 11},
{"seat_id": 16},
{"seat_id": 17}
]Only seats that are free and adjacent by numeric seat_id are included. Seat 14 is free but has no free neighbor.
Constraints