
Let 'N' = 2, 'M' = [3, 1], 'O' = 5.
Day 1: Machine 2 produces an item
Day 2: Machine 2 produces an item
Day 3: Both Machine 1 and Machine 2 produce an item
Day 4: Machine 2 produces an item
Total items produced = 1 + 1 + 2 + 1 = 5 items.
Therefore, the answer is 4 days.
The first line contains three integers, 'N', 'O'.
The second line contains 'N' integers representing the array 'M'.
Return the minimum number of days required to complete the order.
You don’t need to print anything. Just implement the given function.
1 <= 'N' <= 10^5
1 <= 'M[i]' <= 10^9
1 <= 'O' <= 10^9
Time Limit: 1 sec
Approach:
Algorithm: