Code for Complete Overlap Case

In complete overlap case, shouldn’t it be (ss==qs and se==qe). For eg. in the case for 4 4 the code will return value for rang (3-4) only as (3<=4 and 4>=4) according to the complete overlap case.

No @udhavbajaj018
we say complete overlap case only iff ss>=qs and se<=qe.
Now if your query is from 4,4 then it can’t return for range(3,4) as 3<4,
I think that you are misjudging this
you may be considering condition as (ss<=qs and se>=qe which is wrong)

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.