3Sum Closest
Two pointer
Problem
Given an array nums
of n integers and an integer target
, find three integers in nums
such that the sum is closest to target
. Return the sum of the three integers. You may assume that each input would have exactly one solution.
For example:
Solution
Last updated
Was this helpful?