class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
int i;
int j;
vector<int> tmp;
for ( i = 0; i < nums.size( ); i++ ){
for ( j = nums.size()-1; j>i; j-- ){
if ( nums[i] + nums[j] == target )
{
tmp.push_back(i+1);
tmp.push_back(j+1);
}
}
}
return tmp;
}
};
public:
vector<int> twoSum(vector<int>& nums, int target) {
int i;
int j;
vector<int> tmp;
for ( i = 0; i < nums.size( ); i++ ){
for ( j = nums.size()-1; j>i; j-- ){
if ( nums[i] + nums[j] == target )
{
tmp.push_back(i+1);
tmp.push_back(j+1);
}
}
}
return tmp;
}
};