Leetcode 1834: Single-Threaded CPU

You are given n​​​​​​ tasks labeled from 0 to n - 1 represented by a 2D integer array tasks, where tasks[i] = [enqueueTimei, processingTimei] means that the i​​​​​​th​​​​ task will be available to process at enqueueTimei and will take processingTimeito finish processing. You have a single-threaded CPU that can process at most one task at a time and will act in the following way: If the CPU is idle ...