I recently appeared for online assessment for internship at Twitter. Each question was as follows:-
(a b c) where 'a' represent tokent_id; 'b' represents type of action, if its 0 then it means token generation and if its 1 then it represents token destruction; c represents timestamp . Every token has maximum lifespan of N time units after which it will get destroyed on its own. Given logs in the described format and arranged in ascending order wrt to c tell how many tokens are active?