File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
603-consecutive-available-seats Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ seat_id is an auto-increment primary key column for this table.
12
12
Each row of this table indicates whether the ith seat is free or not. 1 means free while 0 means occupied.
13
13
```
14
14
15
+ <br />
16
+
15
17
Write an SQL query to report all the consecutive available seats in the cinema.
16
18
17
19
Return the result table ** ordered** by ` seat_id ` in ** ascending** order.
@@ -20,6 +22,8 @@ The test cases are generated so that more than two seats are consecutively avail
20
22
21
23
The query result format is in the following example.
22
24
25
+ <br />
26
+
23
27
** Example 1:**
24
28
25
29
``` markdown
@@ -43,3 +47,7 @@ output:
43
47
| 5 |
44
48
+---------+
45
49
```
50
+
51
+ <br />
52
+
53
+ Refer to 603-consecutive-available-seats.sql for my solution.
You can’t perform that action at this time.
0 commit comments