You are viewing a single comment's thread. Return to all comments →
C++ solution :
vector<int> matchingStrings(vector<string> strings, vector<string> queries) { map<string, int> m; vector<int> v; for (string s:strings) m[s]++; for (string q:queries) v.push_back(m[q]); return v; }
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 →
C++ solution :