문제 : LeetCode 349. Intersection of Two Arrays
class Solution {
public:
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
vector<int> result;
set<int> n1(nums1.begin(), nums1.end());
set<int> n2(nums2.begin(), nums2.end());
for (auto& n : n2) {
if (n1.find(n) != n1.end()) {
result.push_back(n);
}
}
return result;
}
};

19, 20일차 코딩테스트 문제는 풀지 못했다. 현생이 바빴지만 반성합니다.