Sparse Arrays

  • + 0 comments

    My Python 3 solution:

    def matchingStrings(strings, queries):
        for i in range(len(queries)):
            yield sum([1 for e in strings if queries[i] == e])