This question appeared in CodeCraft 2014 and for practice it is
available here:-
I came to know about a solution to this problem that involved creating a AVL Tree at each node of Segment tree and then doing updations and query with the corresponding AVL Tree.
I was wondering if there is some other solution to this problem…
thanks in advance
Not sure though, but maybe policy based data structure can be stored at each node of the segment tree to give same time complexity as expected in the editorial.