File tree 1 file changed +0
-32
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-32
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 941. Valid Mountain Array
5
- *
6
- * Given an array A of integers, return true if and only if it is a valid mountain array.
7
- *
8
- * Recall that A is a mountain array if and only if:
9
- *
10
- * A.length >= 3
11
- * There exists some i with 0 < i < A.length - 1 such that:
12
- * A[0] < A[1] < ... A[i-1] < A[i]
13
- * A[i] > A[i+1] > ... > A[B.length - 1]
14
- *
15
- *
16
- * Example 1:
17
- *
18
- * Input: [2,1]
19
- * Output: false
20
- * Example 2:
21
- *
22
- * Input: [3,5,5]
23
- * Output: false
24
- * Example 3:
25
- *
26
- * Input: [0,3,2,1]
27
- * Output: true
28
- *
29
- *
30
- * Note:
31
- *
32
- * 0 <= A.length <= 10000
33
- * 0 <= A[i] <= 10000
34
- * */
35
3
public class _941 {
36
4
public static class Solution1 {
37
5
public boolean validMountainArray (int [] A ) {
You can’t perform that action at this time.
0 commit comments