class Solution {

public:

vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {

unordered_map<int,int> lookup;

vector<int> result;

for(auto x: nums1)

lookup[x]++;

for(auto n: nums2){

if(--lookup[n]>=0){

result.push_back(n);

}

```
}
return result;
}
```

};