here is the link of the google kickstart round breaker question
and below is my o(n^2) solution but i am not getting where it is failing
Blockquote
#include
using namespace std;
int main()
{
int t;
int x=1;
cin>>t;
while(t--)
{
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
int count=0;
if(arr[0]>arr[1])
count++;
bool check=true;
for(int i=1;i<n-1;i++)
{
for(int j=0;j<i;j++)
{
if(arr[j]>=arr[i])
check=false;
}
if(check&&(arr[i]>=arr[i+1]))
{
count++;
}
check=true;
}
check=true;
for(int i=0;i<n-1;i++)
{
if(arr[n-1]<=arr[i])
{
check=false;
// cout<<"fgm";
break;
}
}
if(check)
count++;
cout<<"Case #"<<x++<<": "<<count<<endl;
}
}
help me debug so it pass partially correct atleast