Array- Sum of Two Arrays

I can’t understand the problem of sum of two arrays, how the input and output work?

Hey Yuvraj, you will be given input in this format

  • N, size of first array
  • N more input numbers, elements of first array
  • M, size of second array
  • M more input numbers, elements of second array

Output
elements of resultant array which will be the sum of arrays.

for eg.
input:
4
1 0 2 9
5
3 4 5 6 7

output:
3, 5, 5, 9, 6, END

How this output comes?
it is pretty simple, treat the two arrays as two numbers and add them like we add two numbers i.e. add the elements from last one by one.

    1 0 2 9
+ 3 4 5 6 7
= 3 5 5 9 6