KMP Algorithm to find the indexOf a substring in the main string