Build the PrimitiveMedium
3Sum
Write `three_sum(nums)` returning every distinct triplet that sums to zero. Each triplet must be sorted ascending, and no triplet may appear twice. Order of the triplets themselves does not matter.
three_sum([-1, 0, 1, 2, -1, -4]) -> [[-1, -1, 2], [-1, 0, 1]]
Sort, then for each index run the two-pointer scan from Two Sum II across the rest. The entire difficulty is de-duplication: skip a repeated outer value, and after recording a hit, skip repeated values under both inner pointers. Nearly every failed attempt at this problem fails there.
What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.