class Solution
{
public:
vector<int> twoSum(vector<int>& nums, int target)
{
vector<int>twoSum;
map<int,int>tmpmap;
int nsize = nums.size();
for(int i=0;i < nsize; i++)
{
int a = nums[i];
if(tmpmap.find(a) != tmpmap.end())
{
twoSum.push_back(tmpmap[a]);
twoSum.push_back(i);
}
tmpmap[target - a] = i;
}
return twoSum;
}
};