Tap here to switch tabs
Problem
Submissions

Problem: Find Minimum Time to Finish All Jobs II

Find Minimum Time to Finish All Jobs II assigns each job to a unique worker. Return the fewest days for all jobs, rounding each completion time up while workers work simultaneously.

Statement

You are given two 00 indexed integer arrays jobs and workers of equal length n, where jobs[i] represents the amount of work required to complete the ithi^{ {th}} job, and workers[j] represents the daily work capacity of the jthj^{ {th}} worker.

Each worker is assigned to exactly one job, and each job is assigned to exactly one worker. The time required for a worker with capacity workers[j] to finish a job with work jobs[i] is ⌈\lceil jobs[i] // workers[j] ⌉\rceil days. All workers work simultaneously on their assigned jobs.

Return the minimum number of days needed to complete all jobs under an optimal assignment.

Constraints:

  • n == jobs.length == workers.length

  • 1≤1 \leq n ≤105\leq 10^5

  • 1≤1 \leq jobs[i], workers[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find Minimum Time to Finish All Jobs II

Find Minimum Time to Finish All Jobs II assigns each job to a unique worker. Return the fewest days for all jobs, rounding each completion time up while workers work simultaneously.

Statement

You are given two 00 indexed integer arrays jobs and workers of equal length n, where jobs[i] represents the amount of work required to complete the ithi^{ {th}} job, and workers[j] represents the daily work capacity of the jthj^{ {th}} worker.

Each worker is assigned to exactly one job, and each job is assigned to exactly one worker. The time required for a worker with capacity workers[j] to finish a job with work jobs[i] is ⌈\lceil jobs[i] // workers[j] ⌉\rceil days. All workers work simultaneously on their assigned jobs.

Return the minimum number of days needed to complete all jobs under an optimal assignment.

Constraints:

  • n == jobs.length == workers.length

  • 1≤1 \leq n ≤105\leq 10^5

  • 1≤1 \leq jobs[i], workers[i] ≤105\leq 10^5