bool isSorted(long int *arr,int n){
if(n==1 or n==0){
return true;
}
if(arr[0]<arr[1] and isSorted(arr+1,n-1)){
return true;
}
return false;
}
in this, if i replace it with the following:
if(arr[n-1]<arr[n-2]) return false;
return isSorted(arr,n-1);
then it works for all test cases