public:
vector
vector
std::sort(n2.begin(), n2.end());
for (int ii = 0; ii < n2.size(); ++ii) {
int subTarget = target - n2[ii];
bool subFound = std::binary_search(n2.begin()+ii+1, n2.end(), subTarget);
if (subFound) {
vector
for(int jj = 0; jj < numbers.size(); ++jj) {
if (numbers[jj] == n2[ii] || numbers[jj] == subTarget) result.push_back(jj+1);
}
return result;
}
}
return vector
}
};
No comments:
Post a Comment