Hangzhou electric oj on this topic is behind the given string add character as a cycle, with KMP can solve,
And if there is no requirement to add the location of the string at least add number?
Abcb, for example, in the final add is need to 4, and so the ABC b (a) (c), just two, please help!
CodePudding user response:
No limit, if add character position to exist within the search string is repetitive patterns, if you have, will make the fullest use of these repetitive patterns, to reduce the number of characters that are inserted