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.
Your Task:  
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 a and b 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 ≤ 10^{6}
0 ≤ A_{i}, B_{i }≤ 9
No leading zeroes in array A and B.

Difficulty: EASY
Tags: Data structures
Skill types: Data structures
Expected Time Complexity: O(max(N, M))
Expected Auxiliary Space: O(1)

Starter code:
#User function Template for python3
class Solution:

	def findSum(self,a, b):
		# code here

Solutions:
class Solution:

	def findSum(self, a, b):
		num1 = ''
		for item in a:
			num1 += str(item)
		num2 = ''
		for item in b:
			num2 += str(item)
		return map(lambda x: int(x), list(str(int(num1) + int(num2))))


class Solution:

	def findSum(self, a, b):
		n = len(a)
		m = len(b)
		i = n - 1
		j = m - 1
		carry = 0
		res = []
		while i >= 0 or j >= 0:
			if i >= 0:
				carry += a[i]
				i -= 1
			if j >= 0:
				carry += b[j]
				j -= 1
			res.append(carry % 10)
			carry //= 10
		if carry:
			res.append(carry)
		return res[::-1]


class Solution:

	def findSum(self, a, b):
		(n, m) = (len(a), len(b))
		result = []
		carry = 0
		(i, j) = (n - 1, m - 1)
		while i >= 0 or j >= 0 or carry > 0:
			sum = (a[i] if i >= 0 else 0) + (b[j] if j >= 0 else 0) + carry
			carry = sum // 10
			digit = sum % 10
			result.append(digit)
			i -= 1
			j -= 1
		l = len(result)
		return result[l - 1::-1]


class Solution:

	def findSum(self, a, b):
		x = ''
		y = ''
		for i in a:
			x += str(i)
		for i in b:
			y += str(i)
		m = int(x) + int(y)
		return str(m)


class Solution:

	def findSum(self, a, b):
		a = list(map(str, a))
		b = list(map(str, b))
		x = ''.join(a)
		y = ''.join(b)
		s = int(x) + int(y)
		s = str(s)
		ans = list(s)
		return ans


class Solution:

	def findSum(self, a, b):
		a[:] = [str(i) for i in a]
		b[:] = [str(i) for i in b]
		res = [int(i) for i in str(int(''.join(a)) + int(''.join(b)))]
		return res


class Solution:

	def findSum(self, a, b):
		ans = []
		n = len(a)
		m = len(b)
		(i, j) = (n - 1, m - 1)
		summ = 0
		while i >= 0 and j >= 0:
			summ += a[i] + b[j]
			if summ <= 9:
				ans.append(summ)
				summ = 0
			else:
				ans.append(summ % 10)
				summ = summ // 10
			i -= 1
			j -= 1
		if i >= 0:
			while i >= 0:
				summ += a[i]
				if summ <= 9:
					ans.append(summ)
					summ = 0
				else:
					ans.append(summ % 10)
					summ = summ // 10
				i -= 1
		if j >= 0:
			while j >= 0:
				summ += b[j]
				if summ <= 9:
					ans.append(summ)
					summ = 0
				else:
					ans.append(summ % 10)
					summ = summ // 10
				j -= 1
		if summ != 0:
			ans.append(summ)
		return ans[::-1]


class Solution:

	def findSum(self, a, b):
		n = len(a) - 1
		m = len(b) - 1
		i = n
		j = m
		carry = 0
		li = []
		while i >= 0 and j >= 0:
			summ = a[i] + b[j] + carry
			if summ > 9:
				add = summ % 10
				li.append(add)
				carry = 1
			else:
				li.append(summ)
				carry = 0
			i -= 1
			j -= 1
		while i >= 0:
			summ = a[i] + carry
			if summ > 9:
				add = summ % 10
				li.append(add)
				carry = 1
			else:
				li.append(summ)
				carry = 0
			i -= 1
		while j >= 0:
			summ = b[j] + carry
			if summ > 9:
				add = summ % 10
				li.append(add)
				carry = 1
			else:
				li.append(summ)
				carry = 0
			j -= 1
		if carry != 0:
			li.append(carry)
		v = li[::-1]
		return v


class Solution:

	def findSum(self, a, b):
		list1 = [str(i) for i in a]
		list2 = [str(i) for i in b]
		a = int(''.join(list1)) + int(''.join(list2))
		list3 = [q for q in str(a)]
		return list3


class Solution:

	def findSum(self, a, b):
		if len(a) > len(b):
			big = a
			small = b
		else:
			big = b
			small = a
		carry = 0
		base = 0
		diff = len(big) - len(small)
		for i in range(len(small) - 1, -1, -1):
			s = big[i + diff] + small[i] + carry
			carry = s // 10
			base = s % 10
			big[i + diff] = base
		for i in range(diff - 1, -1, -1):
			s = big[i] + carry
			carry = s // 10
			base = s % 10
			big[i] = base
		if carry != 0:
			big.insert(0, carry)
		return big


class Solution:

	def findSum(self, a, b):
		n = len(a)
		m = len(b)
		i = 0
		j = n - 1
		while i < j:
			(a[i], a[j]) = (a[j], a[i])
			i += 1
			j -= 1
		i = 0
		j = m - 1
		while i < j:
			(b[i], b[j]) = (b[j], b[i])
			i += 1
			j -= 1
		if n > m:
			a.append(0)
		else:
			b.append(0)
		carry = 0
		i = 0
		j = 0
		while i < n and j < m:
			temp = a[i] + b[j] + carry
			if temp < 10:
				if n > m:
					a[i] = temp
				else:
					b[j] = temp
				carry = 0
			else:
				if n > m:
					a[i] = str(temp)[-1]
				else:
					b[j] = str(temp)[-1]
				carry = 1
			i += 1
			j += 1
		if n > m:
			while i < n + 1:
				temp = a[i] + carry
				if temp > 9:
					a[i] = str(temp)[-1]
					carry = 1
				else:
					a[i] += carry
					carry = 0
				i += 1
			if a[-1] == 0:
				return a[n - 1::-1]
			return a[n::-1]
		else:
			while j < m + 1:
				temp = b[j] + carry
				if temp > 9:
					b[i] = str(temp)[-1]
					carry = 1
				else:
					b[j] += carry
					carry = 0
				j += 1
			if b[-1] == 0:
				return b[m - 1::-1]
			return b[m::-1]


class Solution:

	def findSum(self, a, b):
		(string, string1) = ('', '')
		for x in a:
			string += str(x)
		for y in b:
			string1 += str(y)
		return str(int(string) + int(string1))


class Solution:

	def findSum(self, a, b):
		l = []
		i = len(a) - 1
		j = len(b) - 1
		carry = 0
		while i >= 0 and j >= 0:
			sm = a[i] + b[j] + carry
			carry = sm // 10
			val = sm % 10
			l.append(val)
			i = i - 1
			j = j - 1
		while i >= 0:
			sm = a[i] + carry
			carry = sm // 10
			val = sm % 10
			l.append(val)
			i = i - 1
		while j >= 0:
			sm = b[j] + carry
			carry = sm // 10
			val = sm % 10
			l.append(val)
			j = j - 1
		while carry != 0:
			sm = carry
			carry = sm // 10
			val = sm % 10
			l.append(val)
		return l[::-1]


class Solution:

	def findSum(self, a, b):
		st1 = ''
		for e in a:
			st1 += str(e)
		st2 = ''
		for e in b:
			st2 += str(e)
		val = int(st1) + int(st2)
		ar = list(str(val))
		arr = []
		for e in ar:
			arr.append(int(e))
		return arr


class Solution:

	def findSum(self, a, b):
		a = [str(i) for i in a]
		b = [str(i) for i in b]
		k = int(''.join(a))
		k2 = int(''.join(b))
		res = k + k2
		res = str(res)
		list1 = [int(i) for i in res]
		return list1


def reverse(arr):
	i = 0
	j = len(arr) - 1
	while i <= j:
		(arr[i], arr[j]) = (arr[j], arr[i])
		i += 1
		j -= 1
	return arr

class Solution:

	def findSum(self, a, b):
		sol = []
		i = len(a) - 1
		j = len(b) - 1
		carry = 0
		while i >= 0 and j >= 0:
			sum1 = a[i] + b[j] + carry
			carry = sum1 // 10
			sum1 = sum1 % 10
			sol.append(sum1)
			i -= 1
			j -= 1
		while i >= 0:
			sum1 = a[i] + carry
			carry = sum1 // 10
			sum1 = sum1 % 10
			sol.append(sum1)
			i -= 1
		while j >= 0:
			sum1 = b[j] + carry
			carry = sum1 // 10
			sum1 = sum1 % 10
			sol.append(sum1)
			j -= 1
		while carry != 0:
			sum1 = carry
			carry = sum1 // 10
			sum1 = sum1 % 10
			sol.append(sum1)
		reverse(sol)
		return sol


class Solution:

	def findSum(self, a, b):
		a = a[::-1]
		b = b[::-1]
		l = [0 for i in range(max(len(a), len(b)) + 1)]
		s = [0 for i in range(max(len(a), len(b)) + 1)]
		for i in range(max(len(a), len(b))):
			if i < min(len(a), len(b)):
				s[i + 1] = (a[i] + b[i] + s[i]) // 10
				s[i] = (a[i] + b[i] + s[i]) % 10
			elif len(a) > len(b) and i >= len(b):
				s[i + 1] = (a[i] + s[i]) // 10
				s[i] = (a[i] + s[i]) % 10
			elif len(b) > len(a) and i >= len(a):
				s[i + 1] = (b[i] + s[i]) // 10
				s[i] = (b[i] + s[i]) % 10
		s = s[::-1]
		if s[0] == 0:
			s.pop(0)
		return s


class Solution:

	def findSum(self, a, b):
		a1 = ''
		for i in a:
			a1 += str(i)
		b1 = ''
		for j in b:
			b1 += str(j)
		res = int(a1) + int(b1)
		val = []
		for i in str(res):
			val.append(i)
		return val


class Solution:

	def findSum(self, a, b):
		n = ''
		m = ''
		for i in a:
			n += str(i)
		for i in b:
			m += str(i)
		res = int(n) + int(m)
		return list(str(res))


class Solution:

	def findSum(self, a, b):
		c = ''
		for i in a:
			c += str(i)
		d = ''
		for i in b:
			d += str(i)
		g = int(c)
		h = int(d)
		k = g + h
		l = str(k)
		m = []
		for i in l:
			m.append(i)
		return m


class Solution:

	def findSum(self, a, b):
		a.reverse()
		b.reverse()
		res = []
		c = 0
		if len(a) < len(b):
			for i in range(len(b) - len(a)):
				a.append(0)
		else:
			for i in range(len(a) - len(b)):
				b.append(0)
		ans = 0
		for i in range(len(a)):
			ans = a[i] + b[i] + c
			if ans >= 10:
				res.append(ans - 10)
				c = 1
			else:
				res.append(ans)
				c = 0
		if c == 1:
			res.append(1)
		res.reverse()
		return res


class Solution:

	def findSum(self, a, b):
		st = ''
		gt = ''
		for i in range(len(a)):
			st = st + str(a[i])
		for j in range(len(b)):
			gt = gt + str(b[j])
		p = str(int(st) + int(gt))
		p = [x for x in p]
		return p


class Solution:

	def findSum(self, a, b):
		num1 = int(''.join(map(str, a)))
		num2 = int(''.join(map(str, b)))
		return list(map(int, list(str(num1 + num2))))


class Solution:

	def findSum(self, a, b):
		carry = 0
		a = a[::-1]
		b = b[::-1]
		res = []
		for i in range(min(len(a), len(b))):
			temp = a[i] + b[i] + carry
			carry = temp // 10
			temp = temp % 10
			res.append(temp)
		i += 1
		while i < len(a):
			temp = a[i] + carry
			carry = temp // 10
			temp = temp % 10
			res.append(temp)
			i += 1
		while i < len(b):
			temp = b[i] + carry
			carry = temp // 10
			temp = temp % 10
			res.append(temp)
			i += 1
		if carry != 0:
			res.append(carry)
			carry = 0
		res = res[::-1]
		return res


class Solution:

	def findSum(self, a, b):
		a1 = ''.join(map(str, a))
		b1 = ''.join(map(str, b))
		return list(str(int(a1) + int(b1)))


class Solution:

	def findSum(self, a, b):
		str1 = ''
		str2 = ''
		for i in a:
			str1 += str(i)
		for i in b:
			str2 += str(i)
		return str(int(str1) + int(str2))


class Solution:

	def findSum(self, a, b):
		s = ''
		l = ''
		for i in a:
			s += str(i)
		for i in b:
			l += str(i)
		v = str(int(s) + int(l))
		return v


class Solution:

	def findSum(self, a, b):
		s1 = ''.join(map(str, a))
		s2 = ''.join(map(str, b))
		z = int(s1) + int(s2)
		return str(z)


class Solution:

	def findSum(self, a, b):
		s1 = ''
		s2 = ''
		s1 = ''.join(map(str, a))
		s2 = ''.join(map(str, b))
		x = int(s1)
		y = int(s2)
		z = x + y
		z1 = str(z)
		for i in z1:
			print(i, end=' ')
		return ''


class Solution:

	def findSum(self, a, b):
		a = ''.join((str(i) for i in a))
		b = ''.join((str(j) for j in b))
		c = int(a) + int(b)
		return str(c)


class Solution:

	def findSum(self, a, b):
		curr = ''
		prev = ''
		for i in a:
			curr = curr + str(i)
		for i in b:
			prev = prev + str(i)
		num = int(curr) + int(prev)
		res = [int(x) for x in str(num)]
		return res


class Solution:

	def findSum(self, a, b):
		(s, su) = ('', '')
		for i in a:
			s += str(i)
		for i in b:
			su += str(i)
		return str(int(s) + int(su))


class Solution:

	def findSum(self, a, b):
		n = len(a)
		m = len(b)
		if len(a) < len(b):
			a = [0] * (m - n) + a
		elif m < n:
			b = [0] * (n - m) + b
		c = 0
		l = []
		for i in range(len(a) - 1, -1, -1):
			t = a[i] + b[i]
			if c:
				t += 1
				c = 0
			if t > 9:
				c = 1
			l.append(t % 10)
		if c:
			l.append(1)
		return l[::-1]
		return l[::-1]


class Solution:

	def findSum(self, a, b):
		result = []
		(m, n) = (len(a), len(b))
		carry = 0
		while m and n:
			addVal = a[m - 1] + b[n - 1] + carry
			if addVal > 9:
				addVal = addVal % 10
				carry = 1
			else:
				carry = 0
			result.append(addVal)
			m = m - 1
			n = n - 1
		while m:
			addVal = a[m - 1] + carry
			if addVal > 9:
				addVal = addVal % 10
				carry = 1
			else:
				carry = 0
			result.append(addVal)
			m = m - 1
		while n:
			addVal = b[n - 1] + carry
			if addVal > 9:
				addVal = addVal % 10
				carry = 1
			else:
				carry = 0
			result.append(addVal)
			n = n - 1
		if carry:
			result.append(carry)
		return result[::-1]


class Solution:

	def findSum(self, a, b):
		k = ''
		for i in a:
			k += str(i)
		c = ''
		for i in b:
			c += str(i)
		s = str(int(k) + int(c))
		a = []
		for i in s:
			a.append(int(i))
		return a


class Solution:

	def findSum(self, a, b):
		s1 = ''
		for i in a:
			s1 += str(i)
		s2 = ''
		for i in b:
			s2 += str(i)
		c = int(s1) + int(s2)
		c = str(c)
		l = []
		for i in c:
			l.append(int(i))
		return l


class Solution:

	def findSum(self, a, b):
		c = [str(i) for i in a]
		d = [str(i) for i in b]
		k = int(''.join(c)) + int(''.join(d))
		m = [int(i) for i in str(k)]
		return m


class Solution:

	def findSum(self, a, b):
		ss = ''
		bb = ''
		for i in a:
			ss += str(i)
		for j in b:
			bb += str(j)
		res = int(ss) + int(bb)
		jj = []
		for k in str(res):
			jj.append(int(k))
		return jj


class Solution:

	def findSum(self, a, b):
		n = len(a)
		m = len(b)
		result = []
		k = max(n, m)
		for i in range(k):
			result.append('0')
		i = n - 1
		j = m - 1
		carry = 0
		while k != 0:
			d = carry
			if i >= 0:
				d += a[i]
			if j >= 0:
				d += b[j]
			carry = d // 10
			d = d % 10
			result[k - 1] = d
			i -= 1
			j -= 1
			k -= 1
		fresult = []
		k = max(n, m)
		if carry > 0:
			fresult.append(carry)
			for i in range(k):
				fresult.append(result[i])
			return fresult
		else:
			return result


class Solution:

	def findSum(self, a, b):
		num1 = ''
		for item in a:
			num1 += str(item)
		num2 = ''
		for item in b:
			num2 += str(item)
		return str(int(num1) + int(num2))


class Solution:

	def findSum(self, a, b):
		s1 = []
		s2 = []
		res = []
		for i in a:
			s1.append(i)
		for i in b:
			s2.append(i)
		c = 0
		while a != [] or b != []:
			(a1, b1) = (0, 0)
			if a != []:
				a1 = a.pop()
			if b != []:
				b1 = b.pop()
			s = a1 + b1 + c
			c = s // 10
			res.append(s % 10)
		if c != 0:
			res.append(c)
		return res[::-1]


class Solution:

	def findSum(self, a, b):
		c = ''
		d = ''
		for i in a:
			c += str(i)
		for j in b:
			d += str(j)
		k = int(c) + int(d)
		return str(k)


class Solution:

	def findSum(self, a, b):
		sum = ''
		sum2 = ''
		for i in range(len(a)):
			sum += str(a[i])
		for i in range(len(b)):
			sum2 += str(b[i])
		a = 0
		a = int(sum) + int(sum2)
		b = str(a)
		l = []
		for i in range(len(b)):
			l.append(int(b[i]))
		return l


class Solution:

	def findSum(self, a, b):
		n = len(a)
		m = len(b)
		outsize = max(n, m)
		output = [0] * (outsize + 1)
		i = n - 1
		j = m - 1
		k = max(n, m)
		carry = 0
		while i >= 0 and j >= 0:
			di = a[i] + b[j] + carry
			output[k] = di % 10
			carry = di // 10
			i -= 1
			j -= 1
			k -= 1
		while i >= 0:
			di = a[i] + carry
			output[k] = di % 10
			carry = di // 10
			i -= 1
			k -= 1
		while j >= 0:
			di = b[j] + carry
			output[k] = di % 10
			carry = di // 10
			j -= 1
			k -= 1
		output[0] = carry
		ans = 0
		i = 0
		while True:
			if output[i] == 0:
				output.pop(0)
				i = 0
			else:
				break
		return output


class Solution:

	def findSum(self, a, b):
		s1 = ''
		s2 = ''
		for i in a:
			s1 += str(i)
		for i in b:
			s2 += str(i)
		n1 = int(s1) + int(s2)
		return [int(x) for x in str(n1)]


class Solution:

	def findSum(self, a, b):
		nums = [str(i) for i in a]
		nums1 = [str(i) for i in b]
		nums = int(''.join(nums))
		nums1 = int(''.join(nums1))
		k = nums + nums1
		ans = str(k)
		ans = [int(i) for i in ans]
		return ans


class Solution:

	def findSum(self, a, b):
		p = ''.join(map(str, a))
		q = ''.join(map(str, b))
		s = int(p) + int(q)
		return str(s)


class Solution:

	def findSum(self, a, b):
		ans = []
		carry = 0
		i = 0
		j = 0
		N = len(a)
		M = len(b)
		while i < len(a) and j < len(b):
			ans.append((a[N - i - 1] + b[M - j - 1] + carry) % 10)
			carry = (a[N - i - 1] + b[M - j - 1] + carry) // 10
			i += 1
			j += 1
		while i < len(a):
			ans.append((a[N - i - 1] + carry) % 10)
			carry = (a[N - i - 1] + carry) // 10
			i += 1
		while j < len(b):
			ans.append((b[M - j - 1] + carry) % 10)
			carry = (b[M - j - 1] + carry) // 10
			j += 1
		if carry != 0:
			ans.append(carry)
			carry = 0
		low = 0
		high = len(ans) - 1
		while low < high:
			temp = ans[low]
			ans[low] = ans[high]
			ans[high] = temp
			high -= 1
			low += 1
		return ans


class Solution:

	def findSum(self, a, b):
		a1 = ''
		b1 = ''
		i = 0
		while i < len(a):
			a1 += str(a[i])
			i += 1
		i = 0
		while i < len(b):
			b1 += str(b[i])
			i += 1
		c = int(a1) + int(b1)
		return str(c)


class Solution:

	def findSum(self, a, b):

		def getLast(arr):
			if arr:
				return arr.pop()
			else:
				return 0
		carry = 0
		n = max(len(a), len(b))
		ans = []
		for i in range(n):
			an = getLast(a)
			bn = getLast(b)
			carry += an + bn
			ans.append(carry % 10)
			carry //= 10
		if carry != 0:
			ans.append(carry)
		ans.reverse()
		return ans


class Solution:

	def findSum(self, a, b):
		s = ' '
		r = ' '
		new = []
		for i in a:
			s += str(i)
		for i in b:
			r += str(i)
		x = int(s)
		y = int(r)
		c = str(int(x + y))
		for i in c:
			new.append(i)
		return new


class Solution:

	def findSum(self, a, b):
		t1 = ''
		for i in a:
			t1 += str(i)
		t2 = ''
		for i in b:
			t2 += str(i)
		t = int(t1) + int(t2)
		return list(str(t))


class Solution:

	def findSum(self, a, b):
		arr = ''
		for i in a:
			arr += str(i)
		brr = ''
		for i in b:
			brr += str(i)
		summ = str(int(arr) + int(brr))
		return summ


class Solution:

	def findSum(self, a, b):
		f = int(''.join(list(map(str, a))))
		g = int(''.join(list(map(str, b))))
		t = f + g
		r = list(map(int, str(t)))
		return r


class Solution:

	def findSum(self, a, b):
		s1 = ''
		s2 = ''
		for i in a:
			s1 = s1 + str(i)
		for j in b:
			s2 = s2 + str(j)
		s3 = int(s1) + int(s2)
		s3 = str(s3)
		ans = list(s3)
		return ans


class Solution:

	def findSum(self, a, b):
		aa = ''
		for i in a:
			aa += str(i)
		bb = ''
		for i in b:
			bb += str(i)
		ab = str(int(aa) + int(bb))
		return list(ab)


class Solution:

	def findSum(self, a, b):
		a = list(map(str, a))
		b = list(map(str, b))
		x = ''.join(a)
		u = ''.join(b)
		s = int(x) + int(u)
		s = str(s)
		s = list(s)
		return s


class Solution:

	def findSum(self, a, b):
		r = 0
		(n, m) = (len(a), len(b))
		(min_s, max_s) = (min(n, m), max(n, m))
		res = a if n > m else b
		for i in range(min_s):
			(idxA, idxB, idx) = (n - i - 1, m - i - 1, max_s - i - 1)
			v = a[idxA] + b[idxB] + r
			res[idx] = v % 10
			r = v // 10
		for i in range(min_s, max_s):
			idx = max_s - i - 1
			v = res[idx] + r
			res[idx] = v % 10
			r = v // 10
		if r > 0:
			return [r] + res
		else:
			return res


class Solution:

	def findSum(self, a, b):
		ar = a[::-1]
		br = b[::-1]
		ans = []
		c = 0
		i = 0
		j = 0
		while i < len(a) and j < len(b):
			val = ar[i] + br[j] + c
			ans.append(val % 10)
			c = val // 10
			i += 1
			j += 1
		if i >= len(a):
			while j < len(b):
				val = br[j] + c
				ans.append(val % 10)
				c = val // 10
				j += 1
		elif j >= len(b):
			while i < len(a):
				val = ar[i] + c
				ans.append(val % 10)
				c = val // 10
				i += 1
		if c != 0:
			ans.append(c)
			return ans[::-1]
		return ans[::-1]


class Solution:

	def findSum(self, a, b):
		A = ''
		B = ''
		for i in a:
			A += str(i)
		for j in b:
			B += str(j)
		return str(int(A) + int(B))


class Solution:

	def findSum(self, a, b):
		res = []
		carry = 0
		a.reverse()
		b.reverse()
		for i in range(max(len(a), len(b))):
			x = 0
			y = 0
			if i < len(a):
				x = a[i]
			if i < len(b):
				y = b[i]
			num = x + y + carry
			res.append(num % 10)
			carry = num // 10
		if carry > 0:
			res.append(carry)
		res.reverse()
		return res


class Solution:

	def findSum(self, a, b):
		a = list(map(str, a))
		b = list(map(str, b))
		x = ''.join(a)
		y = ''.join(b)
		x = int(x)
		y = int(y)
		x = x + y
		x = str(x)
		l = list(x)
		return l


class Solution:

	def findSum(self, a, b):
		s1 = ''
		s2 = ''
		for i in range(len(a)):
			s1 += str(a[i])
		for i in range(len(b)):
			s2 += str(b[i])
		ans = int(s1) + int(s2)
		ans = str(ans)
		res = []
		for i in ans:
			res.append(i)
		return res


class Solution:

	def findSum(self, a, b):

		def converter(arr):
			num = str()
			for i in arr:
				num += str(i)
			return num
		(num1, num2) = (int(converter(a)), int(converter(b)))
		num = str(num1 + num2)
		return list(num)


class Solution:

	def findSum(self, a, b):
		a = int(''.join(map(str, a)))
		b = int(''.join(map(str, b)))
		return [*str(a + b)]


class Solution:

	def findSum(self, a, b):
		n1 = ''
		n2 = ''
		for v in a:
			n1 += str(v)
		for v in b:
			n2 += str(v)
		ans = list(str(int(n1) + int(n2)))
		return ans


class Solution:

	def findSum(self, a, b):
		new = ''
		hosa = ''
		sach = ''
		for i in a:
			new += str(i)
		for i in b:
			hosa += str(i)
		new = int(new) + int(hosa)
		new = str(new)
		for i in new:
			sach += i + ''
		return sach


class Solution:

	def findSum(self, a, b):
		m = ''
		n = ''
		for i in a:
			m = m + str(i)
		for i in b:
			n = n + str(i)
		c = int(m)
		d = int(n)
		f = c + d
		g = str(f)
		l = []
		for i in g:
			l.append(i)
		return l


class Solution:

	def findSum(self, a, b):
		s1 = ''
		s2 = ''
		for i in a:
			s1 = s1 + str(i)
		for i in b:
			s2 = s2 + str(i)
		ans = str(abs(int(s1) + int(s2)))
		sol = []
		for i in ans:
			sol.append(i)
		return sol


class Solution:

	def findSum(self, a, b):
		n = len(a)
		m = len(b)
		if n >= m:
			l = [0] * n
			i = n - 1
			j = m - 1
			k = n - 1
			s = 0
			carry = 0
			while j >= 0:
				s = a[i] + b[j] + carry
				l[k] = s % 10
				carry = s // 10
				j = j - 1
				k = k - 1
				i = i - 1
			while i >= 0:
				s = a[i] + carry
				l[k] = s % 10
				carry = s // 10
				i = i - 1
				k = k - 1
			if carry:
				l.insert(0, carry)
				return l
			else:
				return l
		else:
			l = [0] * m
			i = n - 1
			j = m - 1
			k = m - 1
			s = 0
			carry = 0
			while i >= 0:
				s = a[i] + b[j] + carry
				l[k] = s % 10
				carry = s // 10
				j = j - 1
				k = k - 1
				i = i - 1
			while j >= 0:
				s = b[j] + carry
				l[k] = s % 10
				carry = s // 10
				j = j - 1
				k = k - 1
			if carry:
				l.insert(0, carry)
				return l
			else:
				return l


class Solution:

	def findSum(self, a, b):
		x = ''
		y = ''
		for ele in a:
			x = x + str(ele)
		for ele in b:
			y = y + str(ele)
		z = int(x) + int(y)
		z = str(z)
		l = []
		for ele in z:
			l.append(str(ele))
		return l


class Solution:

	def reverse(self, a):
		if a is None or a.next is None:
			return a
		temp = self.reverse(a.next)
		a.next.next = a
		a.next = None
		return temp

	def findSum(self, ra, rb):
		a.reverse()
		b.reverse()
		carry = 0
		s = []
		i = 0
		j = 0
		while i < len(ra) and j < len(rb):
			temp = ra[i] + rb[j] + carry
			s.append(temp % 10)
			carry = temp // 10
			i += 1
			j += 1
		while i < len(a):
			temp = ra[i] + carry
			s.append(temp % 10)
			carry = temp // 10
			i += 1
		while j < len(b):
			temp = rb[j] + carry
			s.append(temp % 10)
			carry = temp // 10
			j += 1
		if carry == 1:
			s.append(1)
		s.reverse()
		return s


class Solution:

	def findSum(self, a, b):
		s = ''
		s1 = ''
		for i in a:
			s = s + str(i)
		for i in b:
			s1 = s1 + str(i)
		n = int(s)
		n1 = int(s1)
		n2 = n1 + n
		s3 = str(n2)
		return list(s3)


class Solution:

	def findSum(self, a, b):
		l = []
		for i in a:
			l.append(str(i))
		m = []
		for j in b:
			m.append(str(j))
		x = int(''.join(l))
		y = int(''.join(m))
		res = str(x + y)
		s = []
		for i in range(len(res)):
			s.append(res[i])
		return s


class Solution:

	def findSum(self, a, b):
		x = y = ''
		K = []
		for i in a:
			x += str(i)
		for i in b:
			y += str(i)
		z = str(int(x) + int(y))
		for i in z:
			K.append(int(i))
		return K


class Solution:

	def findSum(self, a, b):
		i = len(a) - 1
		j = len(b) - 1
		carry = 0
		ans = []
		while i >= 0 and j >= 0:
			sum = a[i] + b[j] + carry
			carry = sum // 10
			sum = sum % 10
			ans.append(sum)
			i -= 1
			j -= 1
		while i >= 0:
			sum = a[i] + carry
			carry = sum // 10
			sum = sum % 10
			ans.append(sum)
			i -= 1
		while j >= 0:
			sum = b[j] + carry
			carry = sum // 10
			sum = sum % 10
			ans.append(sum)
			j -= 1
		while carry != 0:
			sum = carry
			carry = sum // 10
			sum = sum % 10
			ans.append(sum)
		return ans[::-1]


class Solution:

	def findSum(self, a, b):
		carry = 0
		res = []
		while a and b:
			x = a.pop()
			y = b.pop()
			sumi = x + y + carry
			res.append(sumi % 10)
			carry = sumi // 10
		while a:
			x = a.pop()
			sumi = x + carry
			res.append(sumi % 10)
			carry = sumi // 10
		while b:
			y = b.pop()
			sumi = y + carry
			res.append(sumi % 10)
			carry = sumi // 10
		if carry:
			res.append(carry)
		return res[::-1]


class Solution:

	def findSum(self, a: list, b: list) -> list:
		result = []
		(i, j) = (len(a) - 1, len(b) - 1)
		carry_over = 0
		while i >= 0 and j >= 0:
			number = a[i] + b[j] + carry_over
			result.append(number % 10)
			carry_over = number // 10
			i -= 1
			j -= 1
		while i >= 0:
			number = a[i] + carry_over
			result.append(number % 10)
			carry_over = number // 10
			i -= 1
		while j >= 0:
			number = b[j] + carry_over
			result.append(number % 10)
			carry_over = number // 10
			j -= 1
		if carry_over:
			result.append(carry_over)
		return result[::-1]


class Solution:

	def findSum(self, a, b):
		l = ''
		r = ''
		dev = 0
		pppp = []
		for j in range(0, len(a)):
			k = a[j]
			l += str(k)
		for d in range(0, len(b)):
			s = b[d]
			r += str(s)
		niv = int(l)
		ha = int(r)
		dev = niv + ha
		kk = str(dev)
		for l in kk:
			pppp.append(l)
		return pppp


class Solution:

	def findSum(self, a, b):
		if len(a) < len(b):
			small = a
			big = b
		else:
			small = b
			big = a
		diff = len(big) - len(small)
		new = []
		carry = 0
		for i in range(len(small) - 1, -1, -1):
			num1 = small[i]
			num2 = big[i + diff]
			sum = num1 + num2 + carry
			carry = sum // 10
			base = sum % 10
			new.append(base)
		for j in range(diff - 1, -1, -1):
			num1 = big[j]
			sum = num1 + carry
			carry = sum // 10
			base = sum % 10
			new.append(base)
		if carry != 0:
			new.append(carry)
		return reversed(new)


class Solution:

	def findSum(self, a, b):
		a1 = ''
		b1 = ''
		for i in a:
			a1 += str(i)
		for i in b:
			b1 += str(i)
		a11 = int(a1)
		b11 = int(b1)
		return str(a11 + b11)


class Solution:

	def findSum(self, a, b):
		x = [str(i) for i in a]
		z = int(''.join(x))
		y = [str(i) for i in b]
		t = int(''.join(y))
		res = list(str(z + t))
		return res