Add Knuth-Morris-Pratt algorithm