Arrays target sum

whats wrong in my code ?
on other ide its showing correct output

Hey Shubham, can you copy your code on ide, save it and share that link here, so that we can help you with the code.

https://ide.geeksforgeeks.org/llCDeqqver

Hey Shubham, your code is not giving the correct output as

  1. your output should exactly match the given output format of the problem
  2. you are supposed to print the output in sorted order.
    for eg.
    input:
    5
    5
    2
    3
    4
    1
    6

your code’s output:
5 1
2 4
3 3

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

thanks mam :slight_smile: