The KMP algorithm! Bessie is trapped working for Millisoft Corporation's document-editing division (codenamed "Millisoft Syllable"). She desperately wants to finish her task on this project so that she can transfer to the XBOX-testing group that she's been promised once "Syllable" is shipped. Her task is to implement the Knuth-Morris-Pratt algorithm (which will become the search feature in Millisoft Syllable) in a way that will make debugging as easy as possible for the code-checkers at Millisoft. Thus, her code should adhere closely to the pseudocode (provided by Wikipedia, naturally!) and should read in two strings, one per line: first, the string to find (W) and second, the search string (S) in which it should be found. With those two strings, W and S, Bessie's code needs to output (to standard out) the following information: * First, repeating the string to find * Second, repeating the search string in which to find it * Third, the "Partial match table" (as a list) * Fourth, the location of the first match (or "No match!") * Fifth, a list of the number of times each index in W mismatched a character in the search string S Millisoft's strict output-formatting "enforcers" require Bessie to adhere to the output style below: Problem name: kmp.X [[ Input example: ]] ABCDABD ABC ABCDAB ABCDABCDABDE [[ Output for example input: ]] String to find: ABCDABD Search string: ABC ABCDAB ABCDABCDABDE Partial match table [-1, 0, 0, 0, 0, 1, 2] Match at m = 15 Mismatch totals: [2, 0, 1, 1, 0, 0, 2] [[ Another input example: ]] AAAAAAA AAAAAABAAAAAABAAAAAA [[ Output for 2nd example input: ]] String to find: AAAAAAA Search string: AAAAAABAAAAAABAAAAAA Partial match table [-1, 0, 1, 2, 3, 4, 5] No match! Mismatch totals: [2, 2, 2, 2, 2, 2, 2] [[ A third input example: ]] ABA CB [[ Output for 3rd example input: ]] String to find: ABA Search string: CB Partial match table [-1, 0, 0] No match! Mismatch totals: [2, 0, 0]