L&T Technology Services OA 2024 | Maximum Number of Weeks You Can Work | Greedy Approach
Question · Posted Jun 2026
Problem Statement You are given an integer array milestones where milestones[i] represents the number of tasks in the i-th project. Each week, you must complete exactly one task from any project. However, you cannot work on the same project in two consecutive weeks. Determine the maximum number of weeks you can work while following these rules. Example 1 Input: milestones = [1,2,3] Output: 6 Explanation: One possible schedule: Project 3 → Project 2 → Project 3 → Project 1 → ...
The full answer & interview discussion are available to premium members.
Log in Create a free account