test case 1 not passed
code:
#include
using namespace std;
bool isSorted(int *a,int n,int i){
//base case
if(i==n-1){
return true;
}
//recursive relation
bool issmallerSorted=isSorted(a,n,i+1);
if(issmallerSorted && (a[i]<a[i+1])){
return true;
}
else{
return false;
}
}
int main(){
int a[1000];
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
}
bool ans=isSorted(a,n,0);
if(ans==true){
cout<<"true"<<endl;
}
else{
cout<<"false"<<endl;
}
}