End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
min_diff(i, d) representing the minimum difficulty starting from job i with d days left.d is 1, return the maximum difficulty of jobs from i to the end.i is equal to the length of the job array, return 0 if d is 0, or -1 otherwise.j from i to the end, and for each j, calculate the difficulty of scheduling jobs from i to j on the current day and add it to the result of min_diff(j, d - 1).i with d days left.