Only 1 test case is being passed.could you help me to correct this code
@bhogadi.sreeja19
your code is correct but there is slight mistake in your code. See line 41 and 42, here you declared bool c and used it in line 42 but the c is already declared outside while() loop. So in line 42, c which is outside while() loop is getting considered which is always positive.
Change line 41 and 42 to
bool c1=place(arr,n,c,mid);
if(c1)
will result in correct output.
Thankyou ! Its passing all Test cases !!
1 Like
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.