Sum of two numbers represented as arrays
Easy Accuracy: 47.44% Submissions: 1916 Points: 2

Given two numbers represented by two different arrays A and B. The task is to find the sum array. The sum array is an array representation of addition of two input arrays.

Example 1:

Input:
N = 3, M = 3
A[] = {5, 6, 3}
B[] = {8, 4, 2}
Output: 1 4 0 5
Explanation: As 563 + 842 = 1405.

Example 2:

Input:
N = 6, M = 4
A[] = {2, 2, 7, 5, 3, 3}
B[] = {4, 3, 3, 8}
Output: 2 3 1 8 7 1
Explanation: As 227533 + 4338 = 231871.

You don't need to read input or print anything. Your task is to complete the function findSum() which takes the array(vector) of integers and as parameters and returns an array denoting the answer.

Expected Time Complexity: O(max(N, M))
Expected Auxiliary Space: O(1)

Constraints:
1 ≤ N ≤ M ≤ 106
0 ≤ Ai, B≤ 9
No leading zeroes in array A and B.

We are replacing the old Disqus forum with the new Discussions section given below.

### Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

#### My Submissions:  