post kmp algorithm