We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Sparse Arrays
- Discussions
Sparse Arrays
Sparse Arrays
Sort by
recency
|
232 Discussions
|
Please Login in order to post a comment
A simple solution for C++: vector matchingStrings(vector strings, vector queries) { unordered_map strMp; vector ans; for (string s: strings) strMp[s]++; for (string s: queries) ans.push_back(strMp[s]); return ans;
}
Here my Python Solution:
def matchingStrings(strings, queries): # Write your code here count_list = []
My Python 3 solution:
My Solution for C++ :