Don't know why One test case is not passing

hey guys I am not able to pass the one test case can you guys help me to find the problem in the code

#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define endl “\n”

bool isSorted(ll *a,int i,int n){
if(i==n-1){
return true;
}
return (a[i]<a[i+1])? isSorted(a,i+1,n) : false;
}

int main(){
int n;
cin >> n;
ll arr[n] = {};
for(int i=0;i<n;++i) cin>>arr[i];
(isSorted(arr,0,n))
?cout<<“true”
:cout<<“false”;
return 0;
}

@Deepak388 Please save your code in coding blocks ide and share its link.

1 Like

hey @pratyush63 i have shared the code link with you

@Deepak388 Just replace < with <= in line number 11 and then check.

1 Like

yes how can i forget that ha ha anyway thanks

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.