Two TestCase Shows Wrong

I have successfuly submit the code with two pointer method;
but the above code wrong answer for two testcase , my method (using simply loops ) is correct and it does not shows TLE,so where I am lacking?

Hello @mahroosanwar0901_2642b14836027bbf,
You didn’t sort the array and it is given that you need to print all the pairs in increasing order.

thanks, You can mark as resolved

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.