Logger Rate Limiter
Try to solve the Logger Rate Limiter problem.
We'll cover the following
Statement
For the given stream of message requests and their timestamps as input, you must implement a logger rate limiter system that decides whether the current message request is displayed. The decision depends on whether the same message has already been displayed in the last seconds. If yes, then the decision is FALSE, as this message is considered a duplicate. Otherwise, the decision is TRUE.
Note: Several message requests, though received at different timestamps, may carry identical messages.
Constraint:
-
request.length
-
timestamp
- Timestamps are in ascending order.
- Messages can be written in lowercase or uppercase English alphabets.
Examples
Note: In the following examples, the time limit, , is set to .
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy