Update Knuth-Morris-Pratt