[LeetCode] 16. 3Sum Closet

1 · Rain Hu · Oct. 28, 2022, 2:34 p.m.
no. Hardness: \(\color{orange}\textsf{Medium}\) Ralated Topics: Array、Two Pointers、Sorting 一、題目 Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closet to target. Return *the sum of the three integers`. You may assume that each input would have exactly one solution. Example 1: Input: nums = [-1,2,1,-4], target = 1 Output: 2 Explanation: The sum that is closet to the target is 2....