Company: CARS24
Difficulty: medium
Task Scheduling Using Circular Priority Dequeue Rules: Priority is an integer (higher value indicates higher priority). Execution time is a positive integer (time required to complete the task). The circular priority dequeue should efficiently manage tasks with a large number of tasks. You need to optimize the algorithm for task scheduling based on priority and minimize the execution time overhead. Task You are given M Queries: If Query is of type 1: Dequeue and return the Task name Dequeued. If Query is of type 2: Execute the next task and return the Task name executed. If Query is of type 3: Return the Size of the remaining Dequeue. Input Format The first line contains N , the number of tasks. The second line contains N space-separated TaskNames. The third line contains N space-separated Priorities associated with these TaskNames. The fourth line contains N space-separated Execution times associated with these TaskNames. The fifth line contains M , the number of Queries. The sixth li