Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT arr = [ 1 , 2 , 1 ] NEW_LINE n = len ( arr ) NEW_LINE queries = [ [ 1 , 2 ] , [ 1 , 3 ] ] NEW_LINE answerQueries ( arr , n , queries ) NEW_LINE DEDENT