Driver code
public static void Main ( ) { string s = " abaaab " ; bool [ , ] dp = new bool [ N , N ] ; pre_process ( dp , s . ToCharArray ( ) ) ; int [ , ] queries = { { 0 , 1 } , { 1 , 5 } } ; int q = queries . Length ; for ( int i = 0 ; i < q ; i ++ ) { answerQuery ( queries [ i , 0 ] , queries [ i , 1 ] , dp ) ; } } }