-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Description
LeetCode does not publicly expose users' streak data through its API. However, streak information can still be inferred by analysing a user’s most recent successful submissions. The workaround would include:
- Approach: Periodically (every 30 minutes, within the scheduled stats updates), retrieve and review the latest 20 successful submissions for each user. 20 is the max number of latest submissions that can be retrieved. Then, check if the daily problem has been completed within these submissions. If the daily problem is completed, update the user’s streak data in the database.
- Limitations: There is a minor risk of missing the daily challenge detection if a user submits more than 20 solutions in a 30-minute window. Though this is rare and unlikely.
- User Notifications: If a user has enabled notifications, we could send a ping when their streak updates or when they're planned to miss their streak. Although, how user-specific interactions can be done needs to be explored.