383. Ransom Note
class Solution:
def canConstruct(self, ransomNote: str, magazine: str) -> bool:
counter = Counter(list(magazine))
for ch in ransomNote:
print(counter)
if ch in counter:
if counter[ch] == 0:
return False
counter[ch] -= 1
else:
return False
return True