You have an array of job difficulties and a number representing days. You must complete all jobs in order, scheduling at least job per day across exactly days. Each day's difficulty equals the maximum difficulty among that day's jobs. You want to minimize the sum of daily difficulties. Amazon uses job scheduling problems to test your DP partitioning and optimization skills.
Say jobDifficulty = [6, 5, 4, 3, 2, 1] and d = 2. Splitting as day : [6], day : [5, 4, 3, 2, 1] gives . But day : [6, 5, 4, 3, 2], day : [1] gives , which is better.
If there are fewer jobs than days, return . How would you try each possible way to partition the array into consecutive groups?