Given an array nums, return all unique triplets [nums[i], nums[j], nums[k]] such that i != j != k and nums[i] + nums[j] + nums[k] == 0.
The solution must not contain duplicate triplets.
Strategy: Sort the array, then for each number, use Two Sum II (two pointers) on the remaining elements. Skip duplicates to avoid repeats.
three_sum([-1, 0, 1, 2, -1, -4])
[[-1, -1, 2], [-1, 0, 1]]