FedEx SupplyChain may need to identify three shipment adjustments whose combined impact is zero. Given a list of integers nums, return every unique triplet [a, b, c] such that a + b + c = 0.
Each triplet must use three different positions from the input. Do not return duplicate triplets, even when nums contains repeated values. Return triplets in nondecreasing order, with the overall result in lexicographic order. If no valid triplet exists, return an empty list.
nums, a list of n integers.def three_sum(nums):