Please tell what should I do in this problem as I am getting a tle.
Array Sum Triplets Doubt
you are getting TLE because once you find target sum, you are not updating l and r.
Also debug your code as left and right are not declared!
here is corrected version, now think of removing duplicates!, you may refer to editorial as well.