ping(t)
is called, perform the following steps:
a. Append the current time t
to the end of the sliding window.
b. While the front of the sliding window is less than t - 3000
, pop elements from the front of the window.
c. Return the size of the sliding window, which represents the count of recent requests.