[剑指Offer]41 和为S的两个数字 VS 和为S的连续正数序列 Leetcode T1 Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the s…
题目一:输入一个递增排序的数组和一个数字s,在数组中查找两个数,使得它们的和正好是s.如果有多对数字的和为s,输出任意一对即可. vector<int> findNumberwWithSum(vector<int>&data, int sum) { int n = data.size(); vector<int>result; ) return result; , right = n-; while (left < right) { if (data[le…