Review my code please


could you please review this, I tried it for a few cases and it seems to work but it does not submit : (

hey @debyian for input 7 2 5 your code is giving wrong o/p it should be 4 but it is giving 5. If you want to try debugging the code try it or else tell me if you want to know mistake right away.

i hope you were able to find mistake in your code and correct it. In case you were unable to do so, you need to add n%2 only when l <= mid and r >= mid. Here is your code after necessary changes.

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.