A peak element is strictly greater than its neighbors. Given nums where nums[-1]=nums[n]=-∞, return any peak element index in O(log n) time.
Input: Integer array nums where no adjacent elements are equal.
Output: Index of any peak element.
Input: [1,2,3,1]
Output: 2
Explanation: nums[2]=3>nums[1] and nums[3].Input: [1,2,1,3,5,6,4]
Output: 5
Explanation: nums[5]=6 is a peak.Input: [1]
Output: 0
Explanation: Single element is a peak.1<=nums.length<=1000-2^31<=nums[i]<=2^31-1nums[i]!=nums[i+1]