Given an array A[] we need to find a range which has the maximum size and its minimum element is >= 1. We also need to update this range by decreasing all its elements by 1.
One idea I got is to keep a segment tree for efficient updates. But how do I get the range in <= logarithmic time?
Maybe we can use binary search here.
Thanks