Problems > Decimal to Binary > Editorial

Decimal to Binary — Solution & Editorial

Back to the Problem

Collect remainders modulo 2 while halving, then output them in reverse.

Complexity: O(log N)