This code to check if a array is sorted or not is failing a test case

#include<bits/stdc++.h>
using namespace std;
bool lol(int a[], int n){
if(n==0 or n==1) {
return true;
}
if(a[0] < a[1] and lol(a+1, n-1)){
return true;
}
return false;

}
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
if(lol(a,n)){
cout<<“true”<<endl;
}
else{
cout<<“false”<<endl;
}
}

@kishoretaru hey use a[0] <= a[1] in this condition.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.