Not getting any output

I tried to implement the idea given in hint video but not getting output.

Hello @itsmeshubhamkumar,

It would be great if you would share your code.
That would help me to better understand the problem.

I’ve saved code on CB ide.


thanks

Hello @itsmeshubhamkumar,

  1. You have followed the approach completely as specified in the question:
    You have to sort the array
    Reason:
    To use the approach of target sum two, you need a sorted array (logic of while loop)

  2. ptr2=n-1;

Hope, this would help.
Give a like, if you are satisfied.

1 Like

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.