Test Case issue

I have written the code for the Arrays-Target Sum Pairs question. It passed 3 Test Case but it is showing wrong in the last test case, I reviewed my code many times I don’t know why it is unable to pass all the test cases. https://ide.codingblocks.com/s/316952

@rahulmutreja76
check for this kind on input
5
5 2 3 4 1
6
in your o/p 3 and 3 is also showing which is wrong as there is only one 3

Ohh you are right. I just initialized j = i+1 and it passed all the test cases. Thanks for resolving my issue.