sparse arrays hackerrank solution in python
store = dict()
ans = []
for w in strings:
if w in store:
store[w] +=1 #adding value to the key word(current word in string)
else:
store[w]=1 #assigning 1 to the new word in store
for q in queries:
if q in store:
ans.append(store[q])
else:
ans.append(0)
return ans