0601. Human Traffic of Stadium
Description
+---------------+---------+
| Column Name | Type |
+---------------+---------+
| id | int |
| visit\_date | date |
| people | int |
+---------------+---------+
visit\_date is the primary key for this table.
Each row of this table contains the visit date and visit id to the stadium with the number of people during the visit.
No two rows will have the same visit\_date, and as the id increases, the dates increase as well.Stadium table:
+------+------------+-----------+
| id | visit\_date | people |
+------+------------+-----------+
| 1 | 2017-01-01 | 10 |
| 2 | 2017-01-02 | 109 |
| 3 | 2017-01-03 | 150 |
| 4 | 2017-01-04 | 99 |
| 5 | 2017-01-05 | 145 |
| 6 | 2017-01-06 | 1455 |
| 7 | 2017-01-07 | 199 |
| 8 | 2017-01-09 | 188 |
+------+------------+-----------+
Result table:
+------+------------+-----------+
| id | visit\_date | people |
+------+------------+-----------+
| 5 | 2017-01-05 | 145 |
| 6 | 2017-01-06 | 1455 |
| 7 | 2017-01-07 | 199 |
| 8 | 2017-01-09 | 188 |
+------+------------+-----------+
The four rows with ids 5, 6, 7, and 8 have consecutive ids and each of them has >= 100 people attended. Note that row 8 was included even though the visit\_date was not the next day after row 7.
The rows with ids 2 and 3 are not included because we need at least three consecutive ids.ac
Previous0600. Non-negative Integers without Consecutive OnesNext0602. Friend Requests II: Who Has the Most Friends
Last updated