You are viewing a single comment's thread. Return to all comments →
Python
def matchingStrings(strings, queries): hashTable = dict() result = [] for i in strings: if i in queries: hashTable[i] = 1 + hashTable.get(i,0) else: hashTable[i] = 0 for i in queries: result.append(hashTable.get(i,0)) return result
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 →
Python