Segment Tree - HMAPPY1

I tried this with Segment tree, but my solution is giving AC for only 3 sub tasks

Can anyone help me with this…

i can’t figure out where is the error

Here’s my code =>

Problem link =>

please tell me the test case where it is giving WA…