Hit Counter (Last 5 Minutes)
Medium
Time-Based Design Problems
Design a counter. Commands: 'hit t' records a hit at second t; 'get t' prints the number of hits in the last 300 seconds (times t-299 to t). Times never decrease.
Constraints
1 <= q <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.