Hash Tables: Ransom Note

  • + 0 comments
    "def checkMagazine(magazine, note):
        count_mag = Counter(magazine)
        count_note = Counter(note)
        
        for word in count_note.keys(): 
            if word not in count_mag.keys() or count_note[word] > count_mag[word]:
                print(""No"")
                return 
        print(""Yes"")
    "