Sir , I thought a lot on this but could not build a logic or i can say could not build a tree with the help of which i can start things in a way for segment trees and i searched on web also but could not find a related question or related theme .
Query Bits Logic Discussion
We have to do this thing only. Build segment tree with answer formed by the range stored in the node.
You’ll have to think deeply to know how you will manage to know the power of 2 at each position.
Try once and then I’ll tell you how to do it
om sir , i will try once and let you know if their is a problem i face.
Sir , i think i got the approach .
As i am thinking is that , parent node value should be 2^(range of left sub tree)*value of right sub tree + value of left sub tree . and thus building the tree from bottom to top , but the problem is how to store the range at each node .