How would you implement a consumeTask function using a heap to prioritize deadlines in a task scheduler?
Implement consumeTask(tasks) using Python's heapq. Each task is a dictionary with an integer deadline and an id. Return task IDs in ascending deadline order. If deadlines are equal, preserve the tasks' original input order.
The input is a list of task dictionaries, and the output is a list of task IDs.
def consumeTask(tasks):