By addition of arrays, we mean adding the i’th element of one array to the i’th element of the other array, but the given sample output doesn’t say the same.
Or am i getting it wrong?
Unable to understand the given example
Sidharth, plz share the sample values of the question
4 1 0 2 9 5 3 4 5 6 7 is the input and the output is 3, 5, 5, 9, 6, END
4
1 0 2 9
5
3 4 5 6 7
The sample input here implies that you will have two variables, sum and carry, which will be calculated for every index while traversing from right to left in the array, such that you will have the values like this : 9+7=16, sum =6, carry=1;
2+6+1=9, sum=9, carry=0;
5+0=5, sum=5 , carry=0;
4+1=5, sum=5 , carry=0;
sum=3, carry=0;
thus output will be : 3, 5, 5, 9, 6, END