Tap here to switch tabs
Problem
Submissions

Problem: Minimum Difficulty of a Job Schedule

med
30 min
Try to solve the Minimum Difficulty of a Job Schedule problem.

Statement

You are given an array of integers jobDifficulty and an integer d. The difficulty of the job at index i is jobDifficulty[i].

You must schedule all the jobs over d days. The jobs must be completed in the given order, meaning that you must finish all preceding jobs before starting the next one.

You must complete at least 11 job on each day. The difficulty of a given day is the maximum difficulty among all the jobs performed on that day. The total difficulty of a schedule is the sum of the difficulties of each of the d days.

Return the minimum total difficulty of a job schedule. If it is impossible to schedule all the jobs over d days, return −1-1.

Constraints:

  • 1≤1 \leq jobDifficulty.length ≤300\leq 300

  • 0≤0 \leq jobDifficulty[i] ≤1000\leq 1000

  • 1≤1 \leq d ≤10\leq 10

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Difficulty of a Job Schedule

med
30 min
Try to solve the Minimum Difficulty of a Job Schedule problem.

Statement

You are given an array of integers jobDifficulty and an integer d. The difficulty of the job at index i is jobDifficulty[i].

You must schedule all the jobs over d days. The jobs must be completed in the given order, meaning that you must finish all preceding jobs before starting the next one.

You must complete at least 11 job on each day. The difficulty of a given day is the maximum difficulty among all the jobs performed on that day. The total difficulty of a schedule is the sum of the difficulties of each of the d days.

Return the minimum total difficulty of a job schedule. If it is impossible to schedule all the jobs over d days, return −1-1.

Constraints:

  • 1≤1 \leq jobDifficulty.length ≤300\leq 300

  • 0≤0 \leq jobDifficulty[i] ≤1000\leq 1000

  • 1≤1 \leq d ≤10\leq 10