out of 10 testcases, only 1 test case is wrong
please tell me where my code has gone wrong
the code is given below
#include
using namespace std;
int main() {
int n,i,j;
int flag=0;
cin>>n;
int a[n];
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n-1;i++)
{
if(a[i]>a[i+1])
continue;
else if(a[i]<a[i+1])
{
for(j=i;j<n;j++)
{
if(a[j]>=a[j+1])
{
flag=1;
break;
}
}
}
else
{
flag=1;
break;
}
if(flag==1)
break;
}
if(flag==0)
cout<<"true";
else
cout<<"false";
return 0;
}