I am following what is proposed in the editorial. Either the majority element of left half or the majority element of the right half could be the majority element of the node represented by the segment . For achieving this I am using a hashmap at every node and a majority field to store the majority element to store that value. Rest of the part including update and query are done just as in Sum segment tree using the merge function . Can someone help me , I have spent a lot of time on this question.
Thanks in advance :)