code–https://ide.codingblocks.com/s/383017
ques–https://hack.codingblocks.com/app/contests/1975/798/problem
Doubt == reverse bits
Hey @aaliyah_beg
You can’t store binary number using this
while(a>0)
{
y=a%2;
sum=sum+(y*s);
s*=10;
a/=2;
}
because its 32 digits long when no is maximum and even long long cant save it
Try to directly calculate the sum or use arrays instead.
Sir, long long int should work just like it works in ques https://hack.codingblocks.com/app/contests/1975/399/problem where we may convert decimal to binary
Binary representation of 32 bit integer willbe, when all set
1111111111111111111111111111111
Long long range is
9223372036854775807
That worked there because testcases were weak
But it wont work for good testaces
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.