Concept Flow - Three Sum Problem All Unique Triplets
Sort the array
Fix first element i
Set left = i+1, right = end
While left < right
Sum = nums[i
Add triplet
Skip duplicates
Move i to next unique
Repeat until i reaches end
Return all unique triplets
Sort the array, fix one element, then use two pointers to find pairs that sum to the negative of the fixed element, skipping duplicates to find all unique triplets.
