#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
int main() {
int t, c1, c2, res;
string str1, str2;
cin >> t;
for (int i = 0; i < t; i++) {
c1 = c2 = res = 0;
cin >> str1 >> str2;
c1 = count(str1.begin(), str1.end(), '1');
c2 = count(str2.begin(), str2.end(), '1');
cout << (long)(((pow(10, c1) - 1) / 9) * ((pow(10, c2) - 1) / 9)) << '\n';
}
}
For input:
1
11111 11111
Output is:
123454321
but, here is the problem,
For input:
1
10101 10100
Output is:
1220
Also, for
1
11000 11000
Output:
120
I'm not getting why long is subtracting 1 from the final answer if the length of answer is less than 4?
Note: Here, input string is of length <= 10^5