Given an array of integers, return all unique triplets [a, b, c] such that a + b + c = 0. Elements in a triplet should be in non-descending order, and no duplicate triplets are allowed.
nums = array of integers
List of triplets (each sorted) that sum to 0
Example 1:
Input:
nums = [-1,0,1,2,-1,-4]
Output:
[[-1,-1,2],[-1,0,1]]
Explanation:
Two triplets sum to zero: [-1, -1, 2] and [-1, 0, 1].