解题思路:
(1)根据题目条件判断就好了 哈哈哈哈
class Solution {
public:
bool validMountainArray(vector<int>& A) {
int i=0,length=A.size();
if (length<=2) return false;
while(i<length && i+1<length && A[i]<A[i+1]) {
i++;
}
if (i==0 || i==length-1 || A[i]==A[i+1]) return false;
while(i<length && i+1<length && A[i]>A[i+1]) {
i++;
}
if (i!=length-1) return false;
else return true;
}
};