[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

Deploy Laravel (w/ Laravel Mix) Web App in 5 Min on Heroku.

Understanding Hierarchies When Building An App With React

Javascript’s new Date() 😱

React Hooks — will get you hooked

Swimming In the Javascript with String

Top 5 Animation Libraries in React Native

Javascript beginner must know!

5 Minutes about Javascript — Numbers && BigInteger.js Library

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

WazirX Clone Script: Pave your way towards Successful Crypto Trading

Asterfusion Teralynx based CX-N switches — The RoCE Ready Switch

NBA News & Fantasy Basketball Notes 1/2

The Chasm of Bayan