Maximum length biotonic subarray 1

MAXIMUM LENGTH BIOTONIC SUBARRAY
You are provided n numbers of array. You need to find the maximum length of bitonic subarray. A subarray A[i … j] is biotonic if there is a k with i <= k <= j such that A[i] <= A[i + 1] … <= A[k] >= A[k + 1] >= … A[j – 1] > = A[j] i.e subarray is first increasing and then decreasing or entirely increasing or decreasing.

Input Format:
First line contains integer t which is number of test case. For each test case, it contains an integer n which is the size of array and next line contains n space separated integers.

Constraints:
1<=t<=100
1<=n<=1000000
Output Format:
Print the maximum length.

Sample Input:
2
6
12 4 78 90 45 23
4
40 30 20 10
Sample Output:
5
4
Explanation:
ForMaximum length = 4, 78, 90, 45, 23

my code is here :https://ide.codingblocks.com/s/40771

Hey Nilesh, you are just missing one small thing i.e. the descending sequence can start from anywhere in the middle of the array. So, you also need to track when the descending sequence is starting.

https://ide.codingblocks.com/s/43371
What is the error ?