Please tell me what is wrong in the code.
Second Test Case Wrong
#include using namespace std; bool sorted(int *a,int n) { if(n==0||n==1) { return true;} if(a[0]<a[1] && sorted(a+1,n-1)) { return true;} return false;} int main() { int n; cin>>n; int arr[n]; for(int i=0;i<n;i++) cin>>arr[i]; if(sorted(arr,n)) cout<<“true”; else cout<<“false”; return 0; }
Hey Yaashi, the code you copied here is very ambiguous, can you copy your code on ide, save it and share that link here. Also mention the problem’s name for which you have written this code.
Hey Yaashi, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.