iamantony / CppNotes

My notes about C++
MIT License
1 stars 3 forks source link

Task: ransom note and the magazine #9

Closed iamantony closed 8 years ago

iamantony commented 8 years ago

A ransom note can be formed by cutting words our of a magazine to form a new sentence. How would you figure out if a ransom note (represented as a string) can be formed from a given magazine (string).

Create map with words from magazine and number of their occurance. Then check if all words from ransom note could be from magazine.

iamantony commented 8 years ago

Done: 11afad0cd3bac5826345638bcc1ab6e193ea71e1