At Stripe, you need an in-memory rate limiter that decides whether each request should be allowed.
Implement rate_limit(timestamps, limit, window_seconds) that returns a boolean decision for every request timestamp.
timestamps: list[int] (non-decreasing)limit: int maximum number of allowed requests in any windowwindow_seconds: int window size in secondst, consider the inclusive window [t - window_seconds, t].list[bool] where True means allow, False means deny.def rate_limit(timestamps: list[int], limit: int, window_seconds: int) -> list[bool]: