Kmp for pattern matching and to find out prefix which is suffix also