Minimum Effort Task Schedule
Learn this problemProblem statement
A project manager is assigning a series of tasks for the team. There is a list of n tasks that need to be completed in order, and each requires a level of effort. All the tasks need to be completed within deadline days.
The manager wants to plan the tasks such that there is at least one task on each day and the sum of the levels of effort of all the days is minimum. The level of effort of a day is given by the highest level of effort of any task that is performed on that day. Find this minimum sum of effort.
Complete the function minimumEffort.
minimumEffort has the following parameters:
int efforts[n]: the order and effort required for the tasks.int deadline: the number of days in which all of the tasks must be completed.
Return the minimum overall level of effort that can be achieved with optimal planning.
Function
minimumEffort(efforts: int[], deadline: int) → intExamples
Example 1
efforts = [1, 2, 3, 4, 5]deadline = 3return = 8An optimal plan is:
- Day
1: the first task, with effort1. - Day
2: the second task, with effort2. - Day
3: the remaining tasks, with effortmax(3, 4, 5) = 5.
The sum of the levels of effort of all the days is 1 + 2 + 5 = 8. Return 8.
Constraints
1 <= n <= 3001 <= deadline <= n <= 300
More Microsoft problems
- Binary String Swap TimeOA · Seen Jul 2026
- Maximum Pipeline ThroughputOA · Seen Jul 2026
- Maximum Strong Team SubarrayOA · Seen Jul 2026
- Minimum Cost K-Capable ModelsOA · Seen Jul 2026
- Alphabetically Smallest PalindromeOA · Seen Jul 2026
- Maximum Reward PointsOA · Seen Jul 2026
- Maximum Strength of Every NeuronOA · Seen Jul 2026
- Neural Network Subnetwork StrengthOA · Seen Jul 2026