Closest Pair Sum to Zero — Solution & Editorial
Sort; two pointers from both ends move toward zero: advance the left on negative sums, retreat the right on positive.
Complexity: O(N log N)
Sort; two pointers from both ends move toward zero: advance the left on negative sums, retreat the right on positive.
Complexity: O(N log N)