using namespace std; #include #include void intersection(int a[], int b[], int n, int m){ unordered_set s; for(int i = 0; i < n; i++){ s.insert(a[i]); } for(int i = 0; i < m; i++){ if(s.find(b[i])!=s.end()) cout<