LC: 359. Logger Rate Limiter - spiralgo/algorithms GitHub Wiki

359. Logger Rate Limiter:

The Essence:

The question tries to teach:

  • How to define a class in the programming language of choice.
  • How to keep track of incoming messages and timestamps.

Details:

  • It would be better for the problem-solver to learn how to create a class in the programming language of choice before starting the solution.
  • We can use the message as a key and the timestamp (plus 10 seconds) as a value of a HashMap to keep track of these pieces of information.