struct vp{
int value;
int place;
};
bool comp(const struct vp a, const struct vp b){
return a.value<b.value;
}
class Solution {
public:
vector<int> twoSum(vector<int> &numbers, int target) {
vector<struct vp> v ;
for(int i = ; i < numbers.size(); ++i){
struct vp tmp;
tmp.value = numbers[i];
tmp.place = i;
v.push_back(tmp);
}
sort(v.begin(), v.end(),comp);
for(int i = ; i < v.size(); i++){
for(int j = i+; j < v.size(); j++){
if(v[i].value + v[j].value > target){
break;
}
if(v[i].value + v[j].value < target){
continue;
}
if(v[i].value + v[j].value == target){
vector<int> t ;
t.push_back(v[i].place+);
t.push_back(v[j].place+);
sort(t.begin(),t.end());
return t;
}
}
}
return numbers;
}
};