# 2032. 至少在两个数组中出现的值

class Solution {
public:
vector<int> twoOutOfThree(vector<int>& nums1, vector<int>& nums2, vector<int>& nums3) {
map<int,int> m;
set<int> n;
for (auto num : nums1) {
m[num] = 1;
}
for (auto num : nums2) {
if (m.count(num) && m[num] == 1) n.insert(num);
else m[num] = 2;
}
for (auto num : nums3) {
if (m.count(num)) n.insert(num);
}
return vector<int> {n.begin(), n.end()};
}
};