Array-Target Sum Pairs

Take as input N, the size of array. Take N more inputs and store that in an array. Take as input “target”, a number. Write a function which prints all pairs of numbers which sum to target.

5
1
3
4
2
5
5

1 and 4
2 and 3

2 cases are only passing 2 test cases are not i am not able to find any error. Please help.

@mikki18 hey tushar mittal the first thing is that the given output is in sorted order so you have to sort the array and second thing is that sum=0.