@@techcourses4u oh mb, sry dude. have you figured something more resilient? i got segment tree idea, but its implementation is kind of ugly. I have one link but cant understand what he tries to convey. Thanks ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-y6lVcx2zB8w.html
for odd row ....if 1 0 1 1 , then onePair will be 1 and flipped will also be 1 ..so how the condition if(onePairs%2==0)if(flipped == 0)ans+=2 is going to be satisfied ?
condition will not hit and 2 will not be added to ans. This is correct since flipped is 1, we will convert 0 to 1 during flip which will make 1's count divisble by 4 and no additional operation is required.
after every contest, try to solve problems that you are not able to solve by looking at other people solutions or youtube videos. Slowly slowly you will observe that your level is increasing and now you are able to approach and solve more questions than before.
One of the best explaination , please keep uploading solutions videos after every contest . I solved first two questions but got stuck in third one . And you really make it too easy . Thanks bhaiya