294 easy

カンスーガタっぽく書こうとしたら変な感じになった。

from itertools import groupby


def scrabble(given, make):
    given = {k:(len(list(g))) for k, g in groupby(sorted(given))}
    make = {k:(len(list(g))) for k, g in groupby(sorted(make))}
    return len([True for k, v in make.items() if given[k] >= v]) == len(make)


if __name__ == '__main__':
    assert scrabble("ladilmy", "daily")
    assert not scrabble("eerriin", "eerie")
    assert scrabble("orrpgma", "program")
    assert not scrabble("orppgma", "program")