欢迎24级新生

2094. LeetCode 3Sum Closest

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

输入

Given array nums = [-1, 2, 1, -4], and target = 1.

输出

The sum that is closest to the target is 2.

提示

给定⼀个数组,要求在这个数组中找出 3 个数之和离 target 最近。

登录以提交代码。
单点时限 1 秒
内存限制 128 MB
提交 0
通过 0