@gagangoyal674
Thats not what the mentor meant. When a certain range is updated, it is at that instant that the bits in the entire range are 0 or 1. Thus, what you do is that you maintain two arrays, one of them for the tree and the second for the lazy values. When you arrive at a range that need to be updated, you set its tree value to either 2^len - 1 if the update which has to be made is 1 and 0 if the update which has to be made is 0. You then pass on the updates to its children by updating the lazy value array. When you move from the bottom to the top, the value of a index is the sum of left node( after performing right shift) and the right node.
If you face any difficulty, please feel free to revert.
If my answer was able to resolve your query, please mark the doubt as resolved.