You are given a binary array consists of 0's and 1's , and q queries . q can be large !
in each query you are given a certain range [L , R].
you have to either toggle bits in the given range i.e make 0 = 1 and 1 = 0 .
and on another query you are about to count all 1's in the range of [L,R].
The problem gives a feel of segment tree + lazy propogation . but how to do toggling in segment tree .
how should we update the lazy tree !
Any idea !