------
## 最终结论
```python
def longestMountain(A):
    longest = 0
    n = len(A)
    
    for i in range(1, n - 1):
        if A[i] > A[i - 1] and A[i] > A[i + 1]:
            left = i - 1
            right = i + 1
            
            while left > 0 and A[left] > A[left - 1]:
                left -= 1
            
            while right < n - 1 and A[right] > A[right + 1]:
                right += 1
            
            longest = max(longest, right - left + 1)
    
    return longest
```