Your question is 3Sum Unique Triplets. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
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):