Bootcamps
Masterclasses
Menu
Courses
Account
Login / Sign Up

Bitonic Point

Easy Acceptance 58.67% Points 20

Given an array of integers arr[] that first strictly increases and then potentially strictly decreases, find the bitonic point, which is the maximum element in the array. The bitonic point is the position where elements before it are strictly increasing, and elements after it are strictly decreasing.

Examples
Example 1

Example 1

Input: arr[] = [1, 2, 4, 5, 7, 8, 3]

Output: 8

Explanation: Elements before 8 are strictly increasing [1, 2, 4, 5, 7] and elements after 8 are strictly decreasing [3].

Example 2

Example 2

Input: arr[] = [10, 20, 30, 40, 50]

Output: 50

Explanation: Elements before 50 are strictly increasing [10, 20, 30 40] and there are no elements after 50.

Constraints
  • 3 <= arr.size() <= 10^5
  • 1 <= arr[i] <= 10^6
Hints
  • Expected Time Complexity: O(log n)
  • Expected Auxiliary Space: O(1)
Topics
Searching Algorithm
Companies
Amazon Microsoft Flipkart
Added 11 Apr 2025 58.67% acceptance
Ln 1, Col 1Sign in to save your code
10 20 30 40 50
50