Here is the code for the Carvans …
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t>0)
{
int N;
cin>>N;
if(N==0)
{
cout<<"0"<<endl;
break;
}
int speed[N];
for(int i=0;i<N;i++)
cin>>speed[i];
int maxspeed=1;
for(int i=0,j=i+1;i<N,j<N;i++,j++)
{
if(speed[i]>speed[j])
maxspeed++;
}
cout<<maxspeed<<endl;
maxspeed=0;
t--;
}
return 0;
}
Its showing wrong Answer . Can any body help me what’s wrong in this code or my
understanding in the problem ???