class Solution:
def canConstruct(self, ransomNote: str, magazine: str) -> bool:
hash = [0] *26
for c in magazine:
hash[ord(c)- ord('a')] += 1
for c in ransomNote:
if hash[ord(c)-ord('a')] == 0 :
return False
else:
hash[ord(c)-ord('a')] -= 1
return True
03-09
249
10-29
242