Ultra_fast Mathematician

Is this the correct approach of this problem.
if yes then what is wrong in my code.

hello @sufia.aleena12
see ur logic is correct but it is not passing because of following reasons.
a) u r taking input as integer and in iteger we dont have leading zeros ,which we dont want
ex-> 0100 is treated as 100

b) number of digits in number can be upto 100,
and we dont have any datatype to store such big number.

so simply read both numbers as strings (say a and b)
iterate both strings if a[i]==b[i] cout<<0 otherwise cout<<1

Yes I have solved the problem using strings but I didn’t know what was wrong in my code…Thank you I have got the issue!!!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.