


You do not need to print anything, it has already been taken care of. Just implement the given function.
Let ‘NUM1’ be: “5”
Let ‘NUM2’ be: “21”
The sum of both numbers will be: “26”.
The first line of the input contains an integer, 'T’, denoting the number of test cases.
The first line of each test case contains two strings, ‘NUM1’ and ‘NUM2’, representing the two non-negative integers.
For each test case, print the sum of both the strings.
Print the output of each test case in a separate line.
1 <= T <= 10
1 <= |NUM1|, |NUM2| <= 10^5
NUM1 and NUM2 don’t have leading zeroes.
Where |NUM1| and |NUM2| denote the length of the respective strings.
Time limit: 1 sec
The basic idea is to add the character of the strings individually. We run a loop on both strings simultaneously from the end of the strings and add the sum of the characters. We also keep track of carry and update the result. If at any point sum of characters becomes greater than 9, we update the carry to 1.
Here is the algorithm: