java.lang.Object
g1701_1800.s1723_find_minimum_time_to_finish_all_jobs.Solution

public class Solution extends Object
1723 - Find Minimum Time to Finish All Jobs.<p>Hard</p> <p>You are given an integer array <code>jobs</code>, where <code>jobs[i]</code> is the amount of time it takes to complete the <code>i<sup>th</sup></code> job.</p> <p>There are <code>k</code> workers that you can assign jobs to. Each job should be assigned to <strong>exactly</strong> one worker. The <strong>working time</strong> of a worker is the sum of the time it takes to complete all jobs assigned to them. Your goal is to devise an optimal assignment such that the <strong>maximum working time</strong> of any worker is <strong>minimized</strong>.</p> <p><em>Return the <strong>minimum</strong> possible <strong>maximum working time</strong> of any assignment.</em></p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> jobs = [3,2,3], k = 3</p> <p><strong>Output:</strong> 3</p> <p><strong>Explanation:</strong> By assigning each person one job, the maximum time is 3.</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> jobs = [1,2,4,7,8], k = 2</p> <p><strong>Output:</strong> 11</p> <p><strong>Explanation:</strong> Assign the jobs the following way:</p> <p>Worker 1: 1, 2, 8 (working time = 1 + 2 + 8 = 11)</p> <p>Worker 2: 4, 7 (working time = 4 + 7 = 11)</p> <p>The maximum working time is 11.</p> <p><strong>Constraints:</strong></p> <ul> <li><code>1 <= k <= jobs.length <= 12</code></li> <li><code>1 <= jobs[i] <= 10<sup>7</sup></code></li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • minimumTimeRequired

      public int minimumTimeRequired(int[] jobs, int k)