From the course: Advanced Algorithmic Thinking with Python

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Challenge: Ransom note

Challenge: Ransom note

- [Narrator] We now have a challenge for you on hash tables. The challenge is called the ransom note challenge and it's similar to various challenges you might find on sites like hacker rank and leet code. The idea is that there's a kidnapper who's written a ransom note, and now he's worried that he's going to be traced back through his handwriting. So he gets a magazine and he wants to chop out words from the magazine to see if he can recreate his ransom note. Put more simply, we have a stub for a function called ransom note which takes magazine and note as parameters. And we need to return true if he can replicate his ransom note. That is all the words in the note are available in the magazine and false otherwise. Now the words in the note are case sensitive and you must only use whole words available in the magazine. You cannot use substrings or conatation to create words. Also, don't worry about punctuation. None…

Contents