Solving Peak Index in a Mountain Array in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

  • A.length >= 3

Example 1:

Input: [0,1,0]
Output: 1

Example 2:

Input: [0,2,1,0]
Output: 1

Note:

  1. 3 <= A.length <= 10000
  2. 0 <= A[i] <= 10^6
  • A.length >= 3

  • 3 <= A.length <= 10000

  • 0 <= A[i] <= 10^6

See the full details of the problem Peak Index in a Mountain Array at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go