A modified Naive Pettern Searching algorithn that is optimized for the cases when all characters of pattern are different
static void search ( string pat , string txt ) { int M = pat . Length ; int N = txt . Length ; int i = 0 ; while ( i <= N - M ) { int j ;