Design and implement a per-user sliding-window rate limiter that allows at most N requests in any T-second rolling window. The limiter must expose a single method:
boolean isAllowed(String userId, long currentTime)
When a request arrives you receive the user identifier and the current epoch timestamp (seconds). If the request is within the user’s limit return true and record the request; otherwise return false. The window “slides” continuously: only the requests whose timestamps are ≥ (currentTime – T) count toward the limit. The class must handle millions of users, so keep per-user memory proportional to the number of requests in that user’s current window, not the total history. You may assume timestamps are non-decreasing within a single user but not across users.