题目:
代码:
class Solution:
def validMountainArray(self, A: List[int]) -> bool:
c=-1
if len(A)<=2 :
return False
if A[0]>=A[1]:
return False
for x in range(1,len(A)):
if A[x]>A[x-1]:
continue
if A[x]==A[x-1]:
return False
c=x
break
if c==-1:
return False
for x in range(c,len(A)):
if A[x]>=A[x-1]:
return False
return True