Sort the array first. Then fix one element and use two pointers to find the other two.
Sort the array.
For each index , find pairs in nums[i+1:] that sum to -nums[i].
Use two pointers (like Two Sum II) for the pair search.
Skip duplicates: if nums[i] == nums[i-1], skip. Similarly skip duplicate left/right values.