Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT a = [ 1 , 5 , 4 , 2 , 8 , 6 , 7 ] NEW_LINE n = len ( a ) NEW_LINE q = [ [ 2 , 5 ] , [ 1 , 3 ] , [ 1 , 5 ] , [ 3 , 6 ] ] NEW_LINE m = len ( q ) NEW_LINE solveQueries ( a , n , q , m ) NEW_LINE DEDENT