def TestCase(self): kmp = KMP() rs = kmp.search_MP("abcabcabcabc", "cabc") self.assertListEqual(rs, [2,5,8]) rs = kmp.search_MP("ABC ABCDAB ABCDABCDABDE", "ABCDABD") self.assertListEqual(rs, [15])
def TestCase(self): kmp = KMP() rs = kmp.search_MP("abcabcabcabc", "cabc") self.assertListEqual(rs, [2, 5, 8]) rs = kmp.search_MP("ABC ABCDAB ABCDABCDABDE", "ABCDABD") self.assertListEqual(rs, [15])