commit kmp algorithm, only cover some simple case, need to be verified