Plz see my all test caes of this problem(target )
You have to print the result in sorted order. Your approach will not print the result in such format. Think of an approach which involved sorting the array first and then checking the target.Use some kind of a 2 pointer approach. You can refer the hint video if it is there.
Consider Sample Input
5 1 3 4 2 5 5
Sample Output
1 and 4
2 and 3
Your o/p:
1 and 4
3 and 2
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.