Valid Mountain Array - Practice Coding | SlaveCode
Problems
Scratchpad
Run
Submit
0
0
1
2
3
4
5
6
7
8
9
0
0
1
2
3
4
5
6
7
8
9
:
0
0
1
2
3
4
5
6
7
8
9
0
0
1
2
3
4
5
6
7
8
9
Toggle theme (Current: Custom)
Scratchpad
Run
Submit
Description
Hints
Solutions
941. Valid Mountain Array
Easy
10 Points
Array
Given an array of integers arr, return true if and only if it is a valid mountain array. Recall that arr is a mountain array if and only if:
Examples
Example 1
Input: arr = [2,1] Output: false
Example 2
Input: arr = [3,5,5] Output: false
Example 3
Input: arr = [0,3,2,1] Output: true
Constraints
1 <= arr.length <= 104
0 <= arr[i] <= 104
JAVASCRIPT
Code
Tests
Result
Description
Hints
Solutions
941. Valid Mountain Array
Easy
10 Points
Array
Given an array of integers arr, return true if and only if it is a valid mountain array. Recall that arr is a mountain array if and only if:
Examples
Example 1
Input: arr = [2,1] Output: false
Example 2
Input: arr = [3,5,5] Output: false
Example 3
Input: arr = [0,3,2,1] Output: true
Constraints
1 <= arr.length <= 104
0 <= arr[i] <= 104
JAVASCRIPT
Code
Tests
Result