101
0/304
Loading content...
A platform stores processed event identifiers in the table Logs(log_id).
Column details:
The IDs are not guaranteed to be consecutive. Missing values represent gaps where no event exists.
Task:
Output requirements:
Supported submission environments:
Logs:
| log_id |
|--------|
| 1 |
| 2 |
| 3 |
| 7 |
| 8 |
| 10 |[
{"start_id":1,"end_id":3},
{"start_id":7,"end_id":8},
{"start_id":10,"end_id":10}
]IDs 1-3 are continuous, 7-8 are continuous, and 10 is isolated as a single-length segment.
Logs:
| log_id |
|--------|
| 104 |
| 102 |
| 103 |
| 200 |
| 100 |[
{"start_id":100,"end_id":100},
{"start_id":102,"end_id":104},
{"start_id":200,"end_id":200}
]Order in source rows is irrelevant; ranges are formed after sorting log_id values.
Logs:
| log_id |
|--------|
| 5000 |[
{"start_id":5000,"end_id":5000}
]A single value forms one contiguous segment whose start and end are identical.
Constraints