Driver Code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT A = [ 5 , 7 , 2 , 3 , 1 ] NEW_LINE N = len ( A ) NEW_LINE Q = 3 NEW_LINE query = [ [ 1 , 1 , 3 ] , [ 2 , 2 , 5 ] , [ 1 , 2 , 5 ] ] NEW_LINE solveQueries ( A , N , Q , query ) NEW_LINE DEDENT