3Sum Closest
Locate the three-value combination whose sum is nearest a target by sorting and moving two pointers inward. The visual tracks the best gap so far as the pointers converge.
Locate the three-value combination whose sum is nearest a target by sorting and moving two pointers inward. The visual tracks the best gap so far as the pointers converge.