n jobs and n couriers. Job i takes jobs[i] hours of work, and courier j can work hours[j] hours a day.
Each job goes to exactly one courier, and each courier gets exactly one job. A courier works on their job every day until it is done, and all couriers work in parallel.
Return the fewest days needed to finish every job under the best possible assignment.jobs=[10, 3, 8], hours=[2, 4, 3] → 3
Give the 10-hour job to the 4-hour courier (3 days), the 8-hour job to the 3-hour courier (3 days), and the 3-hour job to the 2-hour courier (2 days). Everyone is done in 3 days, and no faster plan exists: even the fastest courier needs 3 days for the 10-hour job.
jobs=[6, 6], hours=[6, 1] → 6
One courier must take a 6-hour job at 1 hour a day, which takes 6 days.
jobs=[1], hours=[100] → 1
jobs=[10, 3, 8], hours=[2, 4, 3]
3
Run checks the first 3 tests in your browser. Submit checks all 90 tests on the server, hidden ones included.