Little doubt with hint discussed

what will be stored in each segment tree’s node,those which are not leaf nodes?

@chhabrapiyush480 hey,you have to divide the range of query at every node till leaf nodes which contain original array elements and store the result of query from l to r in middle nodes which are not leaf nodes ,hope you get it.

I know that how to solve a segment tree problem in general,i am asking for this particular problem.I know one approach could be to have a segment tree of vectors where each node is storing all bits for that range,i want to know whether is there any better way to do it,as in video i could n’t get properly what sir was saying for original segment tree,but i got what he was saying for lazy tree.

@chhabrapiyush480,yes your approach is correct do it with that way only.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.