Total Pipeline Completion Time
Problem statement
Each row of tasks is [taskTime, taskCount]. A single worker processes every task sequentially. Each of the taskCount tasks in that row takes exactly taskTime time units.
Return the time when all tasks from all rows have completed.
Function
totalPipelineTime(tasks: int[][]) → longExamples
Example 1
tasks = [[3,4],[5,2]]return = 22Four three-unit tasks and two five-unit tasks take 12 + 10 time units.
Example 2
tasks = [[7,1]]return = 7The only task takes seven units.
Example 3
tasks = [[2,0],[4,3]]return = 12The zero-count row contributes nothing.
Constraints
1 <= tasks.length <= 10^5.0 <= taskTime, taskCount <= 10^9.- The answer fits a signed 64-bit integer.