Find Maximum Element in a Bitonic Array
Medium

Problem Statement

A bitonic array is an array that first increases and then possibly decreases. Find the maximum value in such an array. The maximum element is the peak of the array.

Examples

1Example 1
Input:
{ "arr": [ 1, 3, 8, 12, 4, 2 ] }
Output:
12
2Example 2
Input:
{ "arr": [ 3, 5, 15, 50, 11, 10, 8 ] }
Output:
50
3Example 3
Input:
{ "arr": [ 1, 15, 25, 45, 42, 21, 17, 12 ] }
Output:
45
Loading...

Sign in to Run Code and Submit