扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
你可以假设每个输入刚好只有一个答案
给定数组为 [2,7,11,15]
,target = 9
返回 [1,2]
1 vector twoSum(vector &nums, int target) {
2 // write your code here 3 vector result;
4 int low=0;
5 int high=nums.size()-1;
6 while(lowtarget){
8 high--;
9 }
10 else if(nums[low]+nums[high]
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流