Doubt in Array Target Sum pairs

Sir can you tell why I am getting an error

Hello @shyama please wait i am checking your code.

@shyama check this:


from every point you have to check for the possibility of pair.

1 Like

Sir is there a more optimal solution ,

i think yes you can solve this question only using two pointer approach as well.
in that there will be no need of for loop as well.
check this:

1 Like

This is what I tried to do with the hints in the video Thanks sir!

@shyama you can mark this as resolved if your doubt is resolved.

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.