Two pointer approach

as u have told two pointer approach in pair sum question ,

but how this approach work in not sorted array.

as you also have taken example of sorted arary

@shivang10ag_f783c23ff43e9207 u need to sort the array before using 2 pointers approach , so if not sorted do it!

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.