0180. Consecutive Numbers
Description
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| id | int |
| num | varchar |
+-------------+---------+
id is the primary key for this table.**Input:**
Logs table:
+----+-----+
| Id | Num |
+----+-----+
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 2 |
| 5 | 1 |
| 6 | 2 |
| 7 | 2 |
+----+-----+
**Output:**
+-----------------+
| ConsecutiveNums |
+-----------------+
| 1 |
+-----------------+
**Explanation:** 1 is the only number that appears consecutively for at least three times.ac
Last updated