#include
using namespace std;
int main() {
int arr[100000];
int inc[100000]={0};
int dec[100000]={0};
int test,n;
cin>>test;
for(int i=0;i<test;i++)
{
cin>>n;
for(int j=0;j<n;j++)
{
cin>>arr[j];
}
inc[0]=1;
dec[n-1]=1;
for(int j=1;j<n;j++)
{
inc[j]=arr[j]>arr[j-1]?inc[j-1]+1:1;
}
for(int j=n-2;j>=0;j--)
{
dec[j]=(arr[j]>arr[j+1])?dec[j+1]+1:1;
// cout<<dec[j]<<"\n";
}
int maxim=inc[0]+dec[0]-1;
// cout<<maxim<<"\n";
for(int j=1;j<n;j++)
{
maxim=max((inc[j]+dec[j]-1),maxim);
// cout<<maxim<<"\n";
}
cout<<maxim<<"\n";
}
return 0;
}
Please check this code , one test case is not passing.