effort, and they must be done in exactly days days. Tasks are done strictly in order: task i can start only after all earlier tasks are finished. At least one task must be done every day.
The load of a day is the largest workload among that day's tasks. The load of a plan is the sum of the loads of all its days.
Return the minimum load of a plan, or -1 if no plan is possible.effort=[3, 8, 2, 2, 5], days=2 → 11
The best plan does only the task with workload 3 on day one and the rest on day two: 3 + 8 = 11. Splitting into [3, 8] and [2, 2, 5] would give 8 + 5 = 13.
effort=[4, 4], days=3 → -1
There are only two tasks for three days, so some day would be left empty.
effort=[0, 7, 1, 6], days=4 → 14
effort=[3, 8, 2, 2, 5], days=2
11
Run checks the first 3 tests in your browser. Submit checks all 96 tests on the server, hidden ones included.