Can somebody help in this ques. - https://hack.codingblocks.com/app/dcb/725
And check the problem in this code -
https://ide.codingblocks.com/s/176993
Hackerblock DCB (Query bits problem)
Hey u are not updating the entire range of values in for each query
this wont update the entire range from l to r
long long int num = (((1<<(n-l))-1)^((1<<(n-r-1))-1));
It just updates l and r indexes
same for output
take a temporary varibale which is inititialised by values from l to r range
use a for loop to traverse l to r and update the values
your code should look something like this
BUT this question has to be done using segment tree, Prateek bhaiya has a video for the same question