Cannot find the mistake in code. Getting 2 correct cases, 2 wrong

Problem is Arrays - Target Sum Pairs. According to the test cases, I’m getting the correct output but still it’s showing wrong answer for 2 test cases. And now I won’t even get points for submission ?

Link to the code is :
https://ide.codingblocks.com/s/58741

Hey , you are using 2 loops to solve this question , that is why the complexity of it is O (n^2) . Instead you have to solve this in O(n) using sliding window approach .
Given a sorted array , keep two pointers (1- at starting , other at end index )
and check for the sum == target . If the sum is -

  1. Equal to target val , update both the pointers and print
  2. Sum is greater - shift end pointer towards left
  3. Sum is less - shift start pointer to right .