Can you please help me to debug

my code is giving wrong output

hello @Jainish-Patel-1007094602980100
image
here j should be initialised with mid+1.
also check maximum value of n and declare both the array with size greater than max n.

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.