Coalition Control maintains a preloaded set of security recommendations for each customer. Implement a task manager that always claims the highest-priority active recommendation while supporting additions, priority updates, and cancellations.
Tasks with larger priorities are selected first. When priorities are equal, select the lexicographically smaller task ID. A claim operation removes and returns the selected task. If no active task exists, it returns None.
Implement run_task_manager(tasks, operations).
tasks is a list of unique two-element lists, [task_id, priority], where task_id is a string and priority is an integer.operations is a list of operation lists:
['add', task_id, priority]['update', task_id, priority]['cancel', task_id]['claim']claim operation, in order. Do not include results for other operations.def run_task_manager(tasks, operations):