Driver code
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT string = " abcdefgh " ; NEW_LINE n = len ( string ) ; NEW_LINE queries = [ [ 1 , 2 ] , [ 2 , 2 ] , [ 1 , 4 ] , [ 2 , 7 ] ] ; NEW_LINE q = len ( queries ) ; NEW_LINE performQueries ( string , n , queries , q ) ; NEW_LINE DEDENT