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.
- Prepare
- Data Structures
- Arrays
- Sparse Arrays
- Discussions
Sparse Arrays
Sparse Arrays
Sort by
recency
|
2393 Discussions
|
Please Login in order to post a comment
JAVA
Javascript using ES6:
Haskell
java
Creating a defaultdict makes this one pretty easy.
` from collections import defaultdict
def matchingStrings(stringList, queries): hm = defaultdict(int) for key in stringList: hm[key] += 1 return [hm[key] for key in queries] `