Array Target sum

TLE error, my code : https://ide.codingblocks.com/s/628957

hey @atmika2001_f655a0d2e84c0123 your code time complexity is O(n^2) and you have to solve it in O(n) time.
You can use two pointer approach as it is a sorted array
https://ide.codingblocks.com/s/628960 here i have done using two pointer approach please ask if you didn’t understand any step or find any difficulty.

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.