Sum of two array

this is my code, some test cases are failing, please help out with getting the approach right

why are you adding your remainder t to ar2[i-1], what if size of ar2 is smaller than ar1. Consider this testcase
4
9 0 9 9
2
6 7
you code is printing “9, 0, 5, 6, END” and ans should be “9, 1, 6, 5, END”. maintain another variable for remainder.

Also size of final araay ar3 could be greater than both a or b. Consider this example
4
9 0 9 9
4
9 0 0 0
your code prints " 8, 0, 9, 9, END " but ans is “1, 8, 0, 9, 9, END”

Oh alright, thank you

Mark it as resolved if you’ve no more doubt.