79531437

Date: 2025-03-24 15:18:06
Score: 1
Natty:
Report link

I might be very late, but I'm gonna give my answer here.

What you can do is construct the string yourself, starting from the most significant bit, if the current bit is true, then increment one to the string. Then multiply the number by two. Make sure you manage carrying digits.

Another (quicker) way is to use fundamental types for digits. Create a vector of a built-in integer type. Choose a power of ten as the max value. You can represent multiple digits at once with just one value. Then you can iterate over the values and concatenate the stringified values.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: HyperKNF