knuth morris pratt algorithm example