Write a function to find all triplets in a list that sum to zero.
HardProblem Statement
Write a function to find all triplets in a list that sum to zero.
Sample Input
[-1, 0, 1, 2, -1, -4]
Sample Output
[[-1, -1, 2], [-1, 0, 1]]
Limits
Time: 2s · Memory: 256 MB