SUM OF 2 ARRAYS - My answer is incorrect for 2 test cases?

Can u please identify it for me.

share your code please

Please check my code.

your code is not working for the following test case
5
5 4 3 2 1
5
9 8 7 6 5
because your logic is not correct
one approach
The idea is to start traversing both the array simultaneously from the end until we reach the 0th index of either of the array. While traversing each elements of array, add element of both the array and carry from the previous sum. Now store the unit digit of the sum and forward carry for the next index sum. While adding 0th index element if the carry left, then append it to beginning of the number.
2nd approach:

I don’t think my logic was wrong… It’s just that I had not accommodated the fact that carry from most significant digit is NOT to be considered as overflow. Putting that into place I am getting correct answer. Thanks for the testcase which made me realise this.
Corrected Code: https://ide.codingblocks.com/s/87587

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.