There is some issue with compiler right now

this is my code it is giving different answers in case if you comment out first two cout statements and different
answer if you do not comment it out.

use test case 5 6

you indexing array from x to y, whereas array is from 0 to y-x.

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.