I tried to implement this query problem by using segment tree. I have not made many programs with segment tree. I looked for the logic of the problem on the internet and then tried to code it. But my submission is showing WA.Can you please tell me where is the mistake in my code:
/* Code deleted*/