Design Hit Counter

Design a hit counter that counts the number of hits received in the past 5 minutes (300 seconds).

Implement the HitCounter class:

  • hit(timestamp): records a hit at timestamp (in seconds). Mult...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: