1350. Find Minimum Time to Finish All Jobs

MediumBit ManipulationBitmask DPPartitionOptimization

Given job durations and k workers, assign every job to exactly one worker. A worker's working time is the sum of the jobs assigned to them. Return the minimum possible value of the maximum working time across all workers.

Input: A JSON object {"jobs": [<positive integers>], "k": <worker count>}.

Output: Return the minimised maximum working time.

Examples

Example 1
Input: {"jobs":[3,2,3],"k":3}
Output: 3
Explanation: Each worker takes one job, so the maximum is 3.
Example 2
Input: {"jobs":[1,2,4,7,8],"k":2}
Output: 11
Explanation: The balanced split gives a maximum of 11.

Constraints

Asked by

AmazonMicrosoftGoogleMeta
Solve this problem in the editor →