Hi,
please check
Test case failing
Working now. thanks. But please explain why if(n<a[0]&&n>a[s-1])//this condition is wrong, array is not completely sorted // cout<<-1;. is wrong. Even if array is not completely sorted,this condition will hold
yeah it will hold
for all numbers in range
a[s-1] < number < a[0]
you can uncomment that, it should work
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.