Error Detection - 'Array-Sum Of Two Arrays'

Can you please tell me the error I have committed due to which the code is not able to pass 2 test cases in the ‘Array-Sum Of Two Arrays’ problem?

Hello @gaurisha please share your code by saving it on ide.codingblocks.com .

Kindly solve the doubt soon.

@gaurisha think of the case when the test case is like this:
5
3 0 2 9 8
5
8 4 5 6 7
in this, the first digits of both the array when you will add you will not get the number added in your array:
correct ouput is this:1, 1, 4, 8, 6, 5, END
see this correction here:https://ide.codingblocks.com/s/418897

Sir, still one test case is not satisfied.

yes i just saw that:
check this:


this is passing all the test cases.

Sir, Now it works. But can you please tell me the logic for this??

Your logic is correct but you were doing some mistakes like you were not decrementing n and m before for loop because you have already taken the sum of the last digits there and the test case which i have mentioned above you didnt think about that.

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.