You have upcoming interviews and have selected specific chapters from BCtCI to read beforehand. Given an array, page_counts, where each element represents a chapter's page count, and the number of days, days, until your interview, determine the minimum number of pages you must read daily to finish on time. Assume that:
- You must read all the pages of a chapter before moving on to another one.
- If you finish a chapter on a given day, you practice for the rest of the day and don't start the next chapter until the next day.
len(page_counts) <= days.
Example:
- Input:
page_counts = [20, 15, 17, 10], days = 14 - Output:
5
20
0
l
15
1
17
2
10
3
days=14
Step 1 / 5
Step 1:
Search range [1, 20]. l=1, r=20. mid=10.
Pointers: l=1, mid=10, r=20
Focus: default
days=14