Dsa
Binary Search
Medium
Task Completion Time
A project manager has a list of tasks with times to complete them, and needs to determine the minimum time required to complete all tasks without exceeding a given maximum daily work time. The function should return the minimum maximum time taken on any day.
Input format:
- The first line contains two integers, n (number of tasks) and d (max daily work time).
- The second line contains n space-separated integers representing the time required for each task.
Output format:
- Output the minimum maximum time required to complete the tasks.
Example:
Input:
5 8
2 2 3 3 5
Output:
5
Key concepts
binary_searchscheduling
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now