Ping counter

Write codeEasy15 minStripe style

Your task

A request counter receives ping timestamps in strictly increasing order. For each ping at time t, return the number of pings that happened in the inclusive window [t-3000, t] (including the current one). Given the list of timestamps, return the list of counts, one per ping.

Examples

recent_counter(pings: list[int]) -> list[int]
Example 1
Inputrecent_counter([1, 100, 3001, 3002])
Output[1, 2, 3, 3]