← 返回 snapchat 的题目列表Design an Online Counter
类型:online_judge
Design an online counter class with two methods: increment and get. Each call to increment simulates an online request. When get is called, return the number of requests made in the last 5 minutes. Ensure time and space complexities are O(1). Write the implementation and the tests.
Example
Input
Test with multiple increments and get requests over time.