Implement Hit Counter

Implement a Hit Counter that records request timestamps and returns the number of hits in the most recent 300 seconds (5 minutes).

Implement:

hit(timestamp: int) -> None
getHits(timest...

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: