You are viewing a single comment's thread. Return to all comments →
def matchingStrings(strings, queries): result_arr = [] my_dict = {item: 0 for item in queries} for v in strings: if v in my_dict: my_dict[v] += 1 for q in queries: result_arr.append(my_dict.get(q)) return result_arr
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 →