#C3764. Longest Peak Subarray
Longest Peak Subarray
Longest Peak Subarray
You are given an array of integers. A peak subarray is defined as a contiguous subarray that first strictly increases and then strictly decreases, with at least one element in each part. Formally, an index ( i ) is considered a peak if ( a_{i-1} < a_i > a_{i+1} ). Your task is to determine the length of the longest peak subarray in the array. If no such peak exists, return 0.
inputFormat
The input is provided via standard input (stdin).
The first line contains an integer ( n ) representing the number of elements in the array.
The second line contains ( n ) space-separated integers representing the elements of the array.
outputFormat
Output a single integer to standard output (stdout) representing the length of the longest peak subarray. If no peak exists, output 0.## sample
12
1 2 3 4 5 3 1 2 3 4 0 10
7
</p>