Array-target sum pair

https://ide.codingblocks.com/s/48746

sir i executed this code using sorting first and then printing values, but one test case is failing again…

Hey Yukti, your code is not handling all the cases.
for eg.
input:
4
1
2
3
4
5

your code’s output :
2 and 3

but the expected output is :
1 and 4
2 and 3