Pls share approach for the above problem
1)Flatten the tree using Euler Tour of the tree into an array .
2)Now use segment tree operations on the array to answer each query in O(logN) time.
can u share your solution
Karan bro can you help me in a problem?
Will upload the editorial of this problem by tonight.