383. 赎金信

exiaohu 于 2021-12-04 发布

题目链接:383. 赎金信

from collections import Counter


class Solution:
    def canConstruct(self, ransomNote: str, magazine: str) -> bool:
        c = Counter(magazine)
        c.subtract(ransomNote)
        return min(c.values()) >= 0