I am unable to pass 1 test case ,
Here is my code
#include
using namespace std;
bool isSorted(long long int *a,int n)
{
if(n==1)
return true;
if(a[0]<a[1]&&isSorted(a+1,n-1))
{
return true;
}
return false;
}
int main() {
int N;
cin>>N;
long long int a[N];
for(int i=0;i<N;i++)
{
cin>>a[i];
}
if(isSorted(a,N)){
cout<<“true”;
}
else
cout<<“false”;
return 0;
}