Longest Streak Users
Given a table with event logs, find the top five users with the longest continuous streak of visiting the platform in 2020.
Note: A continuous streak counts if the user visits the platform at least once per day on consecutive days.
Example:
Input:
events
table
Column |
Type |
---|---|
user_id |
INTEGER |
created_at |
DATETIME |
url |
VARCHAR |
Output:
Column |
Type |
---|---|
user_id |
INTEGER |
streak_length |
INTEGER |
.....
Loading editor