knuth morris pratt algorithm java