Given an integer array nums, return all unique triplets [nums[i], nums[j], nums[k]] such that i, j, and k are distinct indices and nums[i] + nums[j] + nums[k] == 0.
The result must not contain duplicate triplets.
Input: nums = [-1, 0, 1, 2, -1, -4] Output: [[-1, -1, 2], [-1, 0, 1]] Explanation: Two unique triplets sum to zero.
Input: nums = [0, 1, 1] Output: [] Explanation: No three distinct-index elements sum to zero.
Input: nums = [0, 0, 0] Output: [[0, 0, 0]] Explanation: The only unique triplet is all zeros.
nums = [-1, 0, 1, 2, -1, -4]