Given an array of n integers equal to zero. There are 3 type of queries:
- Increase all elements from l to r by 1
- Decrease all elements from l to r by 1
- Count the number of zeros from l to r
Is there an efficient way to solve this problem in O(N log N), O(N sqrt(N)) or at least O(N log2 N)? Thank you in advance!