Https://leetcode.com/problems/3sum-closest/


why it showing vector.erase i s giving error and in the statement if(tar==target) how to return that we found and break the recursion call?

Hello @Chandra123

Where are you receiving the error related to vector.erase(), I cannot see such an error in your code.
However the logic that you have used is NOT correct.
Here is the correct code

Hello @Chandra123

If you didn’t understand the code or have some doubt, you can leave a reply to this thread and I will explain whatever doubt you will have

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.