Approach hintTry it first, then revealHide
Maintain the XOR of the values in group 0 and in group 1, with prefix XOR for any range. Flipping a range moves its values between the groups, which changes both totals by the XOR of that range.
Maintain the XOR of the values in group 0 and in group 1, with prefix XOR for any range. Flipping a range moves its values between the groups, which changes both totals by the XOR of that range.