Test case fail ho rha ek

one test case is not working .please update my code

#include using namespace std; bool isSorted(int a[],int n) { if(n==0 or n==1) { return true; } if(a[0]<a[1] and isSorted(a+1,n-1)) { return true; } return false; } int main() { int n; cin>>n; int arr[1000]; for(int i=0;i<n;i++) { cin>>arr[i]; } if(isSorted(arr,n)) { cout<<“true”; } else { cout<<“false”; } }

hi @itzzeeshu5,
write a[0] <= a[1] not <
for test case 5 5 5 its also sorted, 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.

reply or send some code