why testcase 3 has been failing in this code
Why testcase 3 has been failing in this code
correct condition of while loop should be
while (left < right)
{}
otherwise your code fail this case
5
5
2
3
4
1
6
here YOUR OUTPUT
1 and 5
2 and 4
3 and 3
Correct Output
1 and 5
2 and 4
Modified code
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.