Concept Flow - Three Sum Problem All Unique Triplets
Sort the array
For each element i
Set left = i+1, right = end
While left < right
Sum == 0?
Add triplet
Skip duplicates
Repeat until all i processed
Return all unique triplets
Sort the array, then for each element use two pointers to find pairs that sum to zero with it, skipping duplicates.
