Here ,why is it giving a wrong ans If I dont include line no 9.
the question-https://leetcode.com/problems/3sum/
Leetcode doubt on 3 sum
This is because we have already considered that number for that position. We need unique triplets. Let’s say it was x. So we have already triplets like<x,yi,zi>.
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.