You are viewing a single comment's thread. Return to all comments →
vector matchingStrings(vector stringList, vector queries) {
unordered_map mymap; vector ans;
for( auto i : stringList){ mymap[i]++; }
for( auto i : queries){ ans.push_back(mymap[i]); }
return ans; }
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
vector matchingStrings(vector stringList, vector queries) {
unordered_map mymap; vector ans;
for( auto i : stringList){ mymap[i]++; }
for( auto i : queries){ ans.push_back(mymap[i]); }
return ans; }