Company: Ubs_1july
Difficulty: medium
Authentication Tokens Problem Description When users are authenticated, they receive an authentication token. This token expires after a system-wide expiryLimit unless it is reset. If a reset request is made on or before the expiry time, the expiry is extended by expiryLimit minutes from the current time. An unexpired token_id can be reset any number of times. A reset issued to a non-existent or an expired token_id is ignored. Once a token_id expires it cannot be reused. Command syntax: [type, token_id, T] Create command: Type 0 generates a token with id token_id at time T . Its expiry is set to T + expiryLimit . Reset command: Type 1 resets the expiry to T + expiryLimit . Start with an empty list of tokens. Perform a sequence of requests sorted ascending by their T parameter. Find the number of tokens that are active after all commands have been executed, at the maximum T of all requests. Examples Example 1: Input: expiryLimit = 4, commands = [[0,1,1], [0,2,2], [1,1,5], [1,2,7]] Outpu