Since the array is increasing first & then decreasing so the maximum element would be the last one in the increasing series & the first one in the decreasing series. SO we can ignore the increasing part and check if the next element is decreasing or not. As soon as we fin...
To solve this efficiently, we need to use the binary search approach. We will sort the array first. Then from left to right, we will be traversing. So say we are at positioni, then we will search for the elementarr[i]+diffon the right-hand side the element which isarr[i+1, n]...