Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //the number of products that Kajol and Safa both own.
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n,m;
- int i,j;
- cin>>n>>m;
- int count=0;
- int kajol[n],safa[m];
- for(i=0; i<n; i++)
- {
- cin>>kajol[i];
- }
- for(j=0; j<m; j++)
- {
- cin>>safa[j];
- }
- //int M=max(n,m);
- for(i=0; i<n; i++)
- {
- for(j=0; j<m; j++)
- {
- if(kajol[i]==safa[j])
- {
- count++;
- }
- }
- }
- cout<<count;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement