Given an array of integers, return all unique triplets that sum to zero.
Sample Input:
[-1, 0, 1, 2, -1, -4]
Sample Output:
[[-1, -1, 2], [-1, 0, 1]]
Hints
Hint 1
Sort the array first to make duplicate detection easier
Hint 2
For each element, use two pointers to find pairs that sum to its negative
Hint 3
Skip duplicates to avoid duplicate triplets