Carry counter
Submissions: 6300   Accuracy:

29.03%

  Difficulty: Easy   Marks: 2

Given two numbers. Add the numbers and find the count of carries in their addition.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow.
Each test case contains two integer N and M as input.

Output:
For each test case, In new line print the count of carries.

Constraints:
1<=T<=1000
1<=N,M<=1018

Example:
Input:
2
345 234
2345 535

Output:
0
1

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Arun Tyagi
Author: arun03


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.