行业知识
leetcode16--最接近的三数之和
2026-11-27 22:10:00
来源:互联网转载
1. 题意
index.php/tags-41973.html" >���最接近的三数之和
()最接近的三数之和
2. 题解
与三数之和类似
()class Solution {public: int threeSumClosest(vector& nums, int target) { sort(nums.begin(), nums.end()); int sz = nums.size(); int sum = nums[0] + nums[1] + nums[2]; for (int i = 0;i