Matrix_Queries doubt in what should be the condition when it does not overlap

This is my code , i think i am getting wrong answer because of query function , non overlapping case , if this is not the case then i would definitely like to know where i am going wrong

What do you mean by Overlapping case ? Can you explain. And also Explain your code a bit.

In query function … if(r<s || l>e){ return ans; }

in query function when ( r< s || l >e )

Any Hint or idea please

Hey @aryan_007


There were 2 small errors with your code. I’ve mentioned them in comments in this code. Great implementation and code structuring otherwise.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.