Given an integer array nums and an integer target, find three integers in nums such that their sum is closest to target. Return that sum.
With nums = [-1, 2, 1, -4] and target = 1, the answer is 2. The triplet [-1, 2, 1] sums to 2, which is the closest to 1.
This is similar to 3Sum, but instead of finding sums equal to zero, you're finding the sum closest to a target. How would you adapt the two-pointer approach?
Constraints: , values from to .