The counter is hit at 'T' = 1
The counter is hit at 'T' = 50
The getHit function at 'T' = 100 returns 2
The counter is hit at 'T' = 250
The getHit function at 'T' = 100 returns 2
The first line of input contains an integer ‘T’ denoting the number of test cases to run. Then the test case follows.
The first line of each test case contains a single integer ‘N’, denoting the number of calls.
The next ‘N’ lines contain two space-separated integers ‘TYPE’, ‘STAMP’ denoting the type of the call and timestamp when this call was made.
If TYPE = 1 it is a hit call, TYPE = 2 it is a getHit call .
For each test case, for all the calls of the second type RETURN the number of hits in the last 5 minutes.
You don’t need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 100
1 <= N <= 5 * 10^3
1 <= STAMP <= 10 ^ 9
It is guaranteed that all calls are done in chronological order.
Time Limit: 1 sec
Missing Number
Longest Subarray With Zero Sum
Merge Two Sorted Arrays Without Extra Space
Ninja And The Strictly Increasing Array
Negative To The End