Precompute the position of each character from each position of String S
static void precompute ( int [ , ] mat , string str , int len ) { for ( int i = 0 ; i < CHAR_SIZE ; ++ i ) mat [ len , i ] = len ;