Create a class Anonymous which contains the method howMany which takes as parameters a tvector<string> headlines containing the headlines which you have cut out as well as a tvector<string> messages with the messages you may want to write, and returns an int which is the total number of messages you can write.
const tvector<string>&,
const tvector<string>&
headlines =
{"Earthquake in San Francisco",
"Burglary at musuem in Sweden",
"Poverty"}
messages =
{"Give me my money back",
"I am the best coder",
"TOPCODER"}
Returns: 2
In the first message we have three 'm's, but there are only two 'm's among the headlines (both in the word "museum"), so this message can't be written.
The second message can be written. Note that the first letter, 'I', only appears as lower case in the headlines, but that's allowed. The last message can also be written, so the method should return 2.
headlines =
{"Programming is fun"}
messages =
{"program","programmer","gaming","sing","NO FUN"}
Returns: 4
The messages "program", "gaming", "sing" and "NO FUN" can all be written but not "programmer" (no 'e's exist). The method should return 4.
headlines =
{"abcdef","abcdef"}
messages =
{"AaBbCc","aabbbcc"," ","FADE"}
Returns: 3
All messages except the second one can be written, because it contains three 'b's but there are only two 'b's available. Also note the message only containing spaces - such a message can of course always be written.