Here is my code for this problem, but I get output errors as the following, could anyone help explain?
the first line is the input array
the thrid line is the parameters for update calls, in this case, there's one such call
the fourth line is the parameters for sum calls, in this case, there's two such calls
the second line indicates the order of which the calls are issued, 1 means sum call, 0 means update call.