You are viewing a single comment's thread. Return to all comments →
Hey .. Here's my python code to sove that problem .. but i don't think it's best for large inputs
count_occurance = [] for i in queries: # O(n) if i in strings: # O(n) count_occurance.append(strings.count(i)) # O(1) else: count_occurance.append(0)
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 →
Hey .. Here's my python code to sove that problem .. but i don't think it's best for large inputs