This is my code for the fast math problem. I scored 50/100. I have checked all the possible test cases. I’ve accounted for negative numbers and I’m printing the leading 0s as well. Can you give me a test case for which this code won’t work?
#include
#include
using namespace std;
#define ll long long
int main() {
ll tc;
cin>>tc;
while(tc–)
{
string m, n;
ll a,b;
cin>>m>>n;
ll l = m.length();
a = stoi(m);
b = stoi(n);
if(a<0)
{
l--;
}
a = abs(a);
b = abs(b);
ll x,y;
ll arr[l],i;
for(i=0;i<l;i++)
{
arr[i]=0;
}
for(i=l-1;i>=0;i--)
{
x = a%10;
y = b%10;
arr[i] = x^y;
a = a/10;
b = b/10;
}
for(i=0;i<l;i++)
{
cout<<arr[i];
}
cout<<endl;
}
return 0;
}