最近好多easy 又水了一天
乱写一通
349. Intersection of Two Arrays
Given two integer arrays nums1 and nums2, return an array of their
intersection. Each element in the result must be unique and you may return
the result in any order.
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
vector<int> cnt(1001,0);
unordered_set<int> a;
unordered_set<int> b;
vector<int> ans;
for(auto i : nums1)
{
a.insert(i);
}
for(auto i : nums2)
{
b.insert(i);
}
for(auto i : a)
{
cnt[i]++;
}
for(auto i : b)
{
cnt[i]