
Solution)class Solution: def canConstruct(self, ransomNote: str, magazine: str) -> bool: magDic = {} for char in magazine: if char in magDic: magDic[char] += 1 else: magDic[char] = 1 for char in ransomNote: if char in magDic: magDic[char] -= 1 if magDic[char] == 0: del magDic[char] else: return False return True Problem: LeetCode Time Complexity: O(m+n) Space Complexity: O(m)Explanation)I think ..