def numSmallerByFrequency(queries, words):
    fre_queries = fre(queries)
    fre_words = sorted(fre(words))[::(- 1)]
    res = []
    for q in fre_queries:
        count = 0
        for w in fre_words:
            if (w <= q):
                break
            else:
                count += 1
        res.append(count)
    return res
def numSmallerByFrequency(queries, words):
    fre_queries = fre(queries)
    fre_words = sorted(fre(words))[::(- 1)]
    res = []
    for q in fre_queries:
        count = 0
        for w in fre_words:
            if (w <= q):
                break
            else:
                count += 1
        res.append(count)
    return res