Microsoft interview question

KMP algorithm based string search problem