Company: Ubs_1july
Difficulty: medium
Authentication Tokens Problem Description When a user authenticates, the system issues an authentication token . Every token carries the same system-wide expiryLimit : a token issued at time T is set to expire at time T + expiryLimit . A token can be kept alive by a reset . A reset made at a time that is on or before the token's current expiry time pushes the expiry out to expiryLimit minutes measured from the time of the reset. A token that is still alive may be reset any number of times. A reset aimed at a token id that was never issued, or at a token that has already expired, is ignored. You are given a list of commands. Each command is a triple [type, token_id, T] : Type 0 - issue. Token token_id is issued at time T , and its expiry becomes T + expiryLimit . If that id is currently in use, or was in use and has since expired, the command issues it again and its expiry becomes T + expiryLimit . (inferred - the source does not say what an issue command does to an id that has bee