[Java][BinarySearch][LeetCode] Peak Index In A Mountain Array #852

  • arr.length >= 3
  • There exists some i with 0 < i < arr.length - 1 such that:
  • arr[0] < arr[1] < ... arr[i-1] < arr[i]
  • arr[i] > arr[i+1] > ... > arr[arr.length - 1]
Input: arr = [0,1,0]
Output: 1




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Introduction to Feedseer

NFT Listing is starting from Klaymint!

How to setup Multiple Environment on REACT

JS: Palindrome Checker

Bedrock Road Block Addon

Supercharged Portable VSCode (with Git and Node.js)

Redux is a right tool for your next project?

Algebraic Data Types in four languages

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
SP Hou

SP Hou

More from Medium

Dev Log 25


How integers are stored in the memory using the two’s complement method ?

How to Control SuperUser Privileges on Linux (sudo)

image of sudo command