Algorithm · ByteDance · Medium
Implement processOperations(operations), which simulates a task scheduler holding a collection of pending tasks. Every task is identified by a unique taskID and carries a start time, timestamp. The scheduler must handle three kinds of operations: addTask(taskID, timestamp): insert a task. If a task with this taskID is already active, overwrite its timestamp with the new value instead. removeTask(taskID): delete the given task. If no such task is pending, the operation has no…