File tree 1 file changed +0
-21
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**852. Peak Index in a Mountain Array
4
- *
5
- * Let's call an array A a mountain if the following properties hold:
6
- *
7
- * A.length >= 3
8
- * There exists some 0 < i < A.length - 1 such that A[0] < A[1] < ... A[i-1] < A[i] > A[i+1] > ... > A[A.length - 1]
9
- * Given an array that is definitely a mountain, return any i such that A[0] < A[1] < ... A[i-1] < A[i] > A[i+1] > ... > A[A.length - 1].
10
- *
11
- * Example 1:
12
- *
13
- * Input: [0,1,0]
14
- * Output: 1
15
- * Example 2:
16
- *
17
- * Input: [0,2,1,0]
18
- * Output: 1
19
- * Note:
20
- *
21
- * 3 <= A.length <= 10000
22
- * 0 <= A[i] <= 10^6
23
- * A is a mountain, as defined above.*/
24
3
public class _852 {
25
4
public static class Solution1 {
26
5
public int peakIndexInMountainArray (int [] A ) {
You can’t perform that action at this time.
0 commit comments