Bitonic Point

easy
Given an array arr of n elements which is first increasing and then may be decreasing, find the maximum element in the array.
Note: If the array is increasing then just print then last element will be the maximum value.

Input Format

Input is managed for you

Output Format

Output is managed for you

Constraints

3 <= n <= 10^6
1 <= arr[i] <= 10^6

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
9
1 15 25 45 42 21 17 12 11
Output
45
Previous
Sentence Similarity
Next
Coin Rows

Related Questions