Valid Mountain Array

Given an array of integers, determine if it is a valid mountain array. A mountain array must have at least three elements, and there must exist an index where elements strictly increase up to that index and then strictly decrease thereafter.

Constraints

  • 1 <= arr.length <= 10^4
  • 0 <= arr[i] <= 10^4
Saving… · 2 lines
class Solution:
def isValidMountainArray(self, arr: List[int]) -> bool:
Console

Click Run to execute sample tests.