Sparse Arrays

  • + 0 comments
    def matchingStrings(strings, queries):
        query_results = []
        for i in range(len(queries)):
            occ = 0
            for j in range(len(strings)):
                if queries[i] == strings[j]:
                    occ += 1
            query_results.append(occ) 
        return query_results