Bob has a dictionary with N words in it. There are Moperators. Each operator is one of two kinds. 1. Add a string to the dictionary. It is guaranteed that the string s was not added before. 2. For the given string s find the number of occurrences of the strings from the dictionary. If some string p from the dictionary has several occurrences in s you should count all of them.
Bob has a dictionary with N words in it. There are M operators. Each operator is one of two kinds. 1. Add a string to the dictionary. It is guaranteed that the string s was not added before. 2. For the given string s find the number of occurrences of the strings from the dictionary. If some string p from the dictionary has several occurrences in s you should count all of them.
(图片来源网络,侵删)
标签: HBC14612string题解