Author: Ismail Hosen
Daffodil International University
Problem Link
//Please follow from main function
#include<bits/stdc++.h>
using namespace std;
vector<string>first, last;
int main()
{
string s, s1;
int n, m, cnt=0;
cin>>n;
for(int i=0; i<n; i++){
cin>>s;
first.push_back(s);
}
cin>>m;
for(int i=0; i<m; i++){
cin>>s1;
cnt=0;
for(int j=0; j<n; j++){
if(s1.compare(first[j])==0){
cnt++;
}
}
cout<<cnt<<endl;
}
return 0;
}
0 Comments