Pin and steer
03/033Sum
Pin one value. Let order guide the others.
The challenge, in plain language +
Given a list of integers, find every distinct group of three values whose sum is zero. A group must use three different input positions, but equal values are allowed when enough copies exist. Return each triple in ascending order and return the triples in lexicographic order, without duplicates. Leave the original list unchanged.
How do you turn the three-value search into a reusable two-pointer search?
This lesson uses 2D: exact positions, widths and comparisons are easier to read in one plane.