Knuth Morris Pratt String Matching Algorithm