I cannot access your code.
Maybe you are not updating the new speed of the car before comparing it with previous one.
Refer My solution: CodeChef: Practical coding for everyone
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
// your code goes here
short int T;
// cin>>T;
scanf("%hi",&T);
for (int i =0 ; i< T; i++){
int N;
// cin>>N;
scanf("%d",&N);
int prev = 0;
int cur;
int count = 0;
for (int j =0; j <N; j++){
// cin>>cur;
scanf("%d",&cur);
if (j == 0){
count++;
prev = cur;
}
else {
if (cur<prev) //checkpoint 1 -> should there be an equal sign ?
count++;
prev = cur;
}
}
cout<<count<<endl;
} // Testcases ends over here
return 0;
}