I am really having difficulty in understanding some pattern searching algorithms like Z function, KMP , Robinson karp algorithm can you please suggest some good tutorials or videos for the same. I have tried to watch some videos on youtube but was unable to understand from them. Also use of Z function came in one recent contest on codeforces.