Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Weeks for Which You Can Work

Try to solve the Maximum Number of Weeks for Which You Can Work problem.

Statement

There are nn projects, indexed from 00 to n−1n - 1. You are given an integer array milestones, where each milestones[i] represents the number of milestones required to complete project ii.

You plan to work on the projects week by week following these rules:

  • In each week, you can complete exactly 11 milestone of any project.

  • You cannot work on milestones of the same project in two consecutive weeks.

Return the maximum number of weeks you can work without violating the given rules.

Constraints:

  • n ==== milestones.length

  • 1≤1 \leq n ≤105\leq 10^5

  • 1≤1 \leq milestones[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Weeks for Which You Can Work

Try to solve the Maximum Number of Weeks for Which You Can Work problem.

Statement

There are nn projects, indexed from 00 to n−1n - 1. You are given an integer array milestones, where each milestones[i] represents the number of milestones required to complete project ii.

You plan to work on the projects week by week following these rules:

  • In each week, you can complete exactly 11 milestone of any project.

  • You cannot work on milestones of the same project in two consecutive weeks.

Return the maximum number of weeks you can work without violating the given rules.

Constraints:

  • n ==== milestones.length

  • 1≤1 \leq n ≤105\leq 10^5

  • 1≤1 \leq milestones[i] ≤109\leq 10^9