a better solution that keeps finding the max(i+A[i]) within an interval.