36. 3Sum
MediumTwo pointers
Return every unique triplet [a, b, c] from nums with a + b + c = 0.
Sort the numbers inside each triplet ascending, and return the triplets in ascending order. Do not repeat a triplet.
Example 1
Input: nums = [-1, 0, 1, 2, -1, -4] Output: [[-1, -1, 2], [-1, 0, 1]]
Constraints
3 ≤ nums.length ≤ 3000