Sum of 2 arrays

what’s going wrong in my code.??

@sounakume Consider input:
3
5 5 5
3
5 5 5

your code’s output:
1, 1, 0, END

but the expected output is:
1, 1, 1, 0, END

Make sure your code handles different cases of carry.

Here I have handled the following cases as u can see in ss. But still not passing. What am I missing still?

@sounakume Check for this case also:
4
1 0 2 9
4
9 1 1 1

Expected Output :
1, 0, 1, 4, 0, END

I am getting expected output with my code. But 2 of my cases are failing.

Please save your updated code at ide.codingblocsk.com and share its link

@sounakume I found some more cases for which your code is failing. Check and try to correct considering these cases:
3
1 2 3
4
9 8 7 6
Your Output:
0, 9, 9, 9, 9, END
Expected Output:
9, 9, 9, 9, END

And

1
1
1
1
Expected Output:
2, END

Ok done, but how do i imagine so many test cases. How do you do this bro?

Don’t worry. By practicing more and more you will be able to think about different edge cases.
I would suggest you to practice on other platforms also like Leetcode along with your course. That will help. There the failed test cases would be shown to you.

Yes I have started practising on leetcode. Doing easy problems now.