tasks[i] = [enqueueTime, processingTime]: task i becomes available at enqueueTime and then needs processingTime uninterrupted time units. A single CPU runs them like this:
- If the CPU is idle and no task is available, it waits until the next task becomes available
- If the CPU is idle and some tasks are available, it starts the one with the shortest processing time. Ties go to the task with the smallest index
- Once started, a task runs to completion, and the CPU may start the next one the moment it finishes
Return the order of task indexes in which the CPU runs them. Aim for O(n log n).
A comparator-based Heap class is already written for you.