You are designing a system to distribute a sequence of tasks among several workers, aiming to minimize the workload difference between them. The input consists of a list of worker names and a list of tasks, where each task is defined by a unique integer id and a positive integer duration.
Tasks are to be assigned sequentially, one at a time, in the given order. For each task, assign it to the worker whose current total workload (the sum of durations for all previously assigned tasks) is the lowest among all workers. If more than one worker has the minimum workload, choose the worker with the lexicographically smallest name.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Stdout
-