Explanation : Since it is a sorted array, we can use binary search to identify the position of the first occurrence of the given integer in (logn) steps. If at all these integer repeats, its appearance has to be continuous because the array is sorted.