class Solution {

public:

vector<int> twoSum(vector<int>& nums, int target) {

```
int m=nums.size();
vector<int> x;
unordered_map<int, int> mp;
for(int i=0;i<m;i++)
{
mp[nums[i]]=i;
}
for(int i=0;i<m;i++)
{
if(mp.find(target-nums[i])!=mp.end() && i!=mp.find(target-nums[i])->second)
{
x.push_back(i+1);
x.push_back((mp.find(target-nums[i])->second)+1);
return x;
}
}
return x;
}
```

};