Minimum Difficulty of a Job Schedule
You want to schedule a list of jobs in d days. Jobs are dependent so you have to finish all jobs from index 0 to i before working on job i+1. Each day you must work on at least one job. The difficulty of a day is the maximum difficulty of a job done that day. Return the minimum sum of difficulties of each day.

30:00

Minimum Difficulty of a Job Schedule
hard
Topics
Companies

You want to schedule a list of jobs in d days. Jobs are dependent so you have to finish all jobs from index 0 to i before working on job i+1. Each day you must work on at least one job. The difficulty of a day is the maximum difficulty of a job done that day. Return the minimum sum of difficulties of each day.

Example 1:
Input: {"jobDifficulty":[6,5,4,3,2,1],"d":2}
Output: 7
Constraints:
  • 1jobDifficulty.length3001 \leq \text{jobDifficulty.length} \leq 300

  • 0jobDifficulty[i]10000 \leq \text{jobDifficulty}[i] \leq 1000

  • 1d101 \leq d \leq 10

Input
arr ={"jobDifficulty":[6,5,4,3,2,1],"d":2}

6 jobs [6, 5, 4, 3, 2, 1] over 2 days. A day costs its hardest job.

State
jobs
[6, 5, 4, 3, 2, 1]
n
6
days
2
Variables
n=6
days=2
Variables
VariableValue
n6
days2
DepthFunction Call
Stack empty
0/44