Suppose that you have an unknown integer array of size N that are hidden from you. Implement the following API:
// if the range sum for the array can be the given parity (i.e, it does not conflict with any previous query calls), we will return true and store the parity information about this range.
// if the range sum for the array cannot be the given parity (i,e, it conflict with a previous query call), we will return false and will not store the parity information about this range.
boolean query(int start, int end, boolean even);Example:
Input: query(2, 10, true), query(2, 9, false), query(10, 10, true)
Output: true, true, false
Explanation: if the range sum from index 2 to index 10 is even and the range sum from index 2 to index 9 is odd, then it cannot be the case that the range sum from index 10 to index 10 is even.