Implement a RecentCounter that counts the number of requests made within the last 3000 milliseconds.
A queue is perfect here:
The queue naturally maintains the sliding window of valid timestamps.
counter.ping(1)
1
counter.ping(100)
2
counter.ping(3001)
3
counter.ping(3002)
3