Task Execution Order on One Processor

Asked at ByteDance · Coding Questions · Difficulty: Medium

A single processor runs a list of tasks, one at a time. Each task is a triple `(taskId, enqueueTime, processingTime)`: it becomes available at `enqueueTime` and needs `processingTime` time units once it starts. Whenever the processor is idle it starts one available task, and your job is to report the order in which tasks start.

Loading the problem…