Driver code
public static void main ( String [ ] args ) { String str = " abcdefgh " ; int n = str . length ( ) ; int queries [ ] [ ] = { { 1 , 2 } , { 2 , 2 } , { 1 , 4 } , { 2 , 7 } } ; int q = queries . length ; performQueries ( str , n , queries , q ) ; } }