Ultra fast mathematician problem wrong output

if the binary no starts from 0 then how do i count its digits ?? pls help

@Ajaypandey
It is mentioned that the numbers can be as large as 100 digits. There is no data type that can store a 100 digit number. Try taking the input in a string and working on it. While we cannot store a 100 digit integer number , we can easily store a 100 character long string. This would also solve the initial 0 problem as they would remain unaffected in a string.

1 Like

but how does this solve the prob of initial 0 ?? like to store the no in a string i will have to do n%10 for each digit or n-- that becomes one digit less when no starts from 0.
ex- how to store 0101 in a string ???

@Ajaypandey
Just simply take a string input . Store 0’s and 1’s as characters rather than digits.
string s1;
cin >> s1;

Do this and you get entire “0101” as a string in s1. No matter how many preceeding zeroes , string will store them all.

1 Like

ohkay !!! then simply compare both digitwise , i think i got it , tysm !!!

@tarunluthra bhaiya only one case is passsing , can u pls check this code

@Ajaypandey
Put a new line space for every testcase.

thanks a lot !!!

@Ajaypandey
Please mark your doubt as resolved if your problem has been solved. If you are still facing some issue , please let me know and I can help you out.