2666. Minimum Time to Eat All Grains

Hard
Array
Two Pointers
Binary Search
Sorting

Description

Hints

Hint 1
Binary search the answer.
Hint 2
To check if an answer is possible, for the ith hen check how far right it can go after ensuring that it eats the leftmost uneaten grain.
Hint 3
If the last grain is eaten in this process, the answer is possible.

Statistics

Acceptance
40.0%
Submissions
5,196
Accepted
2,079