Given a list of numbers nums, find every group of three numbers that adds up to 0. The three numbers must come from three different positions in the list.
Each group of three values should appear only once in the answer, even if it can be made in many ways. You may return the groups in any order, and the numbers inside a group in any order.
Examples
Example 1:
Input: nums = [-4,2,2,0,-2,4]
Output: [[-4,0,4],[-4,2,2],[-2,0,2]]
Explanation: -4 + 0 + 4, -4 + 2 + 2 and -2 + 0 + 2 all add up to 0. The two 2s sit at different positions, so [-4,2,2] is allowed.
Example 2:
Input: nums = [1,2,3]
Output: []
Explanation: The only group is 1 + 2 + 3 = 6, not 0. So the answer is empty.
Example 3:
Input: nums = [3,0,0,0,-3]
Output: [[-3,0,3],[0,0,0]]
Explanation: The groups are -3 + 0 + 3 and 0 + 0 + 0. Three different zeros can be chosen in three ways, but [0,0,0] is listed only once.