Driver Code
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT arr = [ 2 , 3 , 6 , 7 , 4 , 5 , 30 ] NEW_LINE queries = [ 6 , 5 ] NEW_LINE N = len ( arr ) NEW_LINE M = len ( queries ) NEW_LINE calculateQuery ( arr , N , queries , M ) NEW_LINE DEDENT