Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Given a candidate, can you check if it is possible to decrement all values to be less than or equal to 0 within the given steps in O(N) time?
If so, run a binary search to look for the minimum such valid candidate.