TEST CASE 1 SHOWING WRONG

#include
using namespace std;

bool IsSorted(int *A,int i,int n)
{
if(i==n-1)
return true;

if(A[i]<A[i+1])
  return IsSorted(A,i+1,n);
  
else  
  return false;

}

int main()
{
int n;
cin>>n;
int *A=new int[n];
for(int i=0;i<n;i++)
cin>>A[i];

if(IsSorted(A,0,n))
  cout<<"true";

else
  cout<<"false";

}

hi @Mukul-Shane-1247687648773500, write <= instead of < else code is correct

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.