vector<int> answer;
int ans=0;
for(int i=0;i<Q;i++){
int qsi=query[i].length();
int count=0;
for(int j=0;j<N;j++){
int lsj=li[j].length();
if(lsj>=qsi){
for(int k=0;k<qsi;k++){
if(query[i][k]==li[j][k]) count++;
else break;
}
if(count==qsi) ans++;
count=0;
}
}
answer.push_back(ans);
ans=0;
}
return answer;
To embed this project on your website, copy the following code and paste it into your website's HTML: