题目:
代码:自己写的,不错
class Solution:
def canConstruct(self, ransomNote: str, magazine: str) -> bool:
c = set(ransomNote)
for c1 in c:
if ransomNote.count(c1)>magazine.count(c1):
return False
return True