• + 0 comments

    I notice alot of these solutions process 2x. an easy way is to just use Counter and collect values that have keys in the counter.

    ex: (Psuedo)

    result = [] c = Counter(strings)

    for q in queries: c[q] ? result.append(c[q]) : result.append(0)