1285. Find the Start and End Number of Continuous Ranges
Description
+---------------+---------+
| Column Name | Type |
+---------------+---------+
| log\_id | int |
+---------------+---------+
id is the primary key for this table.
Each row of this table contains the ID in a log Table.
Logs table:
+------------+
| log\_id |
+------------+
| 1 |
| 2 |
| 3 |
| 7 |
| 8 |
| 10 |
+------------+
Result table:
+------------+--------------+
| start\_id | end\_id |
+------------+--------------+
| 1 | 3 |
| 7 | 8 |
| 10 | 10 |
+------------+--------------+
The result table should contain all ranges in table Logs.
From 1 to 3 is contained in the table.
From 4 to 6 is missing in the table
From 7 to 8 is contained in the table.
Number 9 is missing in the table.
Number 10 is contained in the table.ac
Previous1284. Minimum Number of Flips to Convert Binary Matrix to Zero MatrixNext1286. Iterator for Combination
Last updated