If query is of type 1 then the array elements are over - written by the record array
if ( command [ i ] [ 0 ] == 1 ) : NEW_LINE INDENT arr [ command [ i ] [ 1 ] - 1 ] += record [ i ] NEW_LINE if ( ( command [ i ] [ 2 ] - 1 ) < n - 1 ) : NEW_LINE INDENT arr [ ( command [ i ] [ 2 ] ) ] -= record [ i ] NEW_LINE DEDENT DEDENT