Simple enough problem


why i am getting wrong answer

Hey @Harshit13,
It might be because you’re not taking care of the integers that do not fit into the range of ‘int’.
This question is same as the query function that we used in segment tree.
You can check this out for your reference : https://ide.codingblocks.com/s/197079