Company: Agoda_25july
Difficulty: medium
Token Management System Problem Description A session service hands out access tokens. Every token is issued with the same time-to-live time_to_live : a token created or renewed at time t stays valid until time t + time_to_live . The service processes a list of q queries, one per line, in the order given: generate <token_id> <current_time> — create a new token with the given id at time current_time . renew <token_id> <current_time> — extend an existing, unexpired token at time current_time . The request is ignored if that token has already expired or was never created. count <current_time> — report how many tokens are unexpired at time current_time . Important Note: expiration is applied before any action at the same timestamp. If a token's expiration time is exactly equal to current_time , the token is already expired: it cannot be renewed and it is not counted. Function Description Complete the function getUnexpiredTokens in the editor: